Escolar Documentos
Profissional Documentos
Cultura Documentos
How to Create Bridge? Create files ifcfg-br0 & ifcfg-br1 and edit ifcfgeth0 & ifcfg-eth1 files as shown in the following examples.
File: /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=172.27.25.58
NETMASK=255.255.240.0
GATEWAY=172.27.16.254
DNS1=172.27.16.1
DNS2=172.31.1.130
DOMAIN=cse.iitk.ac.in
DEFROUTE=yes
IPV6INIT=no
USERCTL=no
#HWADDR=5c:f3:fc:96:f8:b8
File: /etc/sysconfig/network-scripts/ifcfg-br1
DEVICE=br1
TYPE=Bridge
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=192.168.1.58
NETMASK=255.255.255.0
DEFROUTE=yes
IPV6INIT=no
USERCTL=no
#HWADDR=5c:f3:fc:96:f8:ba
File: /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=5c:f3:fc:96:f8:b8
NM_CONTROLLED=yes
ONBOOT=yes
TYPE=Ethernet
BRIDGE=br0
IPV6INIT=no
USERCTL=no
File: /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=5c:f3:fc:96:f8:ba
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
BRIDGE=br1
IPV6INIT=no
USERCTL=no
#ifconfig
br0
Link encap:Ethernet HWaddr 5C:F3:FC:96:F8:B8
inet addr:172.27.25.58 Bcast:172.27.31.255
Mask:255.255.240.0
inet6 addr: fe80::5ef3:fcff:fe96:f8b8/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2568 errors:0 dropped:0 overruns:0 frame:0
TX packets:89 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
br1
eth1
lo
virbr0
Channel Bonding
Network Interfaces (NIC) Into a Single Interface
Step #1: Create a Bond0 Configuration File
Red Hat Enterprise Linux (and its clone such as CentOS) stores network configuration in
/etc/sysconfig/network-scripts/ directory. First, you need to create a bond0 config file as
follows:
# vi /etc/sysconfig/network-scripts/ifcfg-bond0
You need to replace IP address with your actual setup. Save and close the file.
Save file and exit to shell prompt. You can learn more about all bounding options by
clicking
here).
Make sure everything is working. Type the following cat command to query the current
status of
Linux kernel bounding driver, enter:
# cat /proc/net/bonding/bond0
Sample outputs:
Bonding Mode: load balancing (round-robin)
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 200
Down Delay (ms): 200
Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:c6:be:59
Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:c6:be:63
Sample outputs:
bond0 Link encap:Ethernet HWaddr 00:0C:29:C6:BE:59
inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:2804 errors:0 dropped:0 overruns:0 frame:0
TX packets:1879 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:250825 (244.9 KiB) TX bytes:244683 (238.9 KiB)
eth0 Link encap:Ethernet HWaddr 00:0C:29:C6:BE:59
inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fec6:be59/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:2809 errors:0 dropped:0 overruns:0 frame:0
TX packets:1390 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:251161 (245.2 KiB) TX bytes:180289 (176.0 KiB)
Interrupt:11 Base address:0x1400
eth1 Link encap:Ethernet HWaddr 00:0C:29:C6:BE:59
inet addr:192.168.1.20 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fec6:be59/64 Scope:Link
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:502 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:258 (258.0 b) TX bytes:66516 (64.9 KiB)
Interrupt:10 Base address:0x1480
IP Aliasing:
More than one IP can be assigned to an physical interface, bond, virtual interface,
bridges etc. Some examples are given below.
ifconfig eth0:1 172.27.29.102
ifconfig bond0:1 172.27.25.60
ifconfig lo:0 172.27.29.102
Policy Routing
Problem Statement: One server is to be connected to two internet leased lines. If one
leased line is not functional, traffic will go by other leased line.
Fact Known: In one system one can use multiple routing tables. By default single routing
table is in use.
Steps:
[1] Add one new routing table name entry in /etc/iproute2/rt-tables. Entry will look like
252
rttbl2
Here rttbl2 is table name and 252 is its id
This table will be created inside the kernel. There will be multiple routing tables inside
kernel (local, main & default).
[2] Populate this table with routing like:
ip route add default table rttbl2 via 172.27.25.250
{Here 172.27.25.250 is the default gateway for second leased line}
[3] Assign routing table to one interface/ip like:
ip rule add from 172.27.25.60 table rttbl2
{Here 172.27.25.60 is one of the IP of a server. It can be aliased IP also}
Above two commands can be kept in /etc/rc.local file for automatic boot time execution.
File: /etc/rc.local
#Dual Leased Line Networking Configuration
ip route add default table rttbl2 via 172.27.25.250 &
ip rule add from 172.27.25.60 table rttbl2 &
[4] check table content of rttbl2 using following command.
ip route list table rttbl2
[5] Testing:
traceroute s 172.27.25.60 www.google.com
It will display the following.
1 172.27.25.250 (172.27.25.250) 3.266 ms 1.497 ms 0.785 ms
2 115.248.232.222 (115.248.232.222) 1.974 ms 1.778 ms 1.912 ms
3 220.224.153.54 (220.224.153.54) 33.085 ms 32.265 ms 32.302 ms
4 115.255.239.53 (115.255.239.53) 72.668 ms 69.040 ms 65.283 ms
5 72.14.197.229 (72.14.197.229) 63.163 ms 63.286 ms 63.159 ms
6 72.14.232.202 (72.14.232.202) 63.277 ms 63.269 ms 63.386 ms
7 72.14.232.100 (72.14.232.100) 72.947 ms 72.767 ms 72.764 ms
8 209.85.249.235 (209.85.249.235) 72.886 ms 72.885 ms 72.882 ms
9 maa03s05-in-f16.1e100.net (74.125.236.80) 70.879 ms 70.879 ms 72.997 ms
Q. I've installed Red Hat Enterprise Linux 5.2 and I see virbr0 network interface along
with my eth0 interface? What it is? How do I disable or remove virbr0?
A. virbr0 is xen interface used by Virtualization guest and host oses for network
communication. Following are the packages under Red Hat / CentOS Linux:
Group: Virtualization
Description: Virtualization Support.
Mandatory Packages:
=> xen
=> kernel-xen
Default Packages:
=> virt-manager
=> Virtualization-en-US
=> gnome-applet-vm
=> libvirt
You can disable virbr0 if you don't need xen Virtualization support, enter:
# yum groupremove "Virtualization"
Sample output:
Loading "rhnplugin" plugin
Loading "security" plugin
Setting up Group Process
rhel-x86_64-server-vt-5
100% |=========================| 1.4 kB
00:00
rhn-tools-rhel-x86_64-ser 100% |=========================| 1.2 kB
00:00
rhel-x86_64-server-5
100% |=========================| 1.4 kB
00:00
No package matched to remove
No package matched to remove
No package matched to remove
No package matched to remove
No package matched to remove
Resolving Dependencies
--> Running transaction check
---> Package libvirt.x86_64 0:0.3.3-7.el5 set to be erased
--> Processing Dependency: libvirt.so.0()(64bit) for package: libvirtpython
--> Processing Dependency: libvirt = 0.3.3 for package: libvirt-python
--> Running transaction check
---> Package libvirt-python.x86_64 0:0.3.3-7.el5 set to be erased
--> Processing Dependency: libvirt-python for package: rhnvirtualization-host
--> Running transaction check
---> Package rhn-virtualization-host.noarch 0:1.0.1-55 set to be erased
--> Finished Dependency Resolution
Dependencies Resolved
=======================================================================
======
Package
Arch
Version
Repository
Size
=======================================================================
======
Removing:
libvirt
x86_64
0.3.3-7.el5
installed
3.4 M
Removing for dependencies:
libvirt-python
x86_64
0.3.3-7.el5
installed
230 k
rhn-virtualization-host noarch
1.0.1-55
installed
155 k
Transaction Summary
=======================================================================
======
Install
0 Package(s)
Update
0 Package(s)
Remove
3 Package(s)
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing
: libvirt-python
#########################
[1/3]
Erasing
: rhn-virtualization-host
#########################
[2/3]
Stopping crond: [ OK ]
Starting crond: [ OK ]
Erasing
: libvirt
#########################
[3/3]
Removed: libvirt.x86_64 0:0.3.3-7.el5
Dependency Removed: libvirt-python.x86_64 0:0.3.3-7.el5 rhnvirtualization-host.noarch 0:1.0.1-55
Complete!