Node Bridge Setup Print

  • 0

Every SolusVM node need to be configured with bridging, both external and internal interfaces. This guide explains how to setup a dedicated network bridge for Linux virtualization. The guide also presumes the external network interface is eth0 and the external bridge will be called br0. Internal network interface is eth1, and the internal bridge will be called intbr0.

1. Make sure both interfaces are in working order before proceeding.
- Ping any external host
# ping google.com
- Ping any internal host
# ping 10.0.28.15

2. Bridging requires the bridge-utils package to be installed on the server. To check if it's installed, do the following:
# rpm -q bridge-utils

If you get an output it's installed, if not, it needs installing:-
# yum install bridge-utils

3. Before setting up your bridge, backup all /etc/sysconfig/network-scripts/ifcfg-* files:-
# cd /etc/sysconfig/network-scripts
# cp -avi ifcfg-* /root/

4. Start with the external interface. Edit /etc/sysconfig/network-scripts/ifcfg-eth0 and modify the lines marked as <----- :-

DEVICE=eth0
TYPE=Ethernet
UUID=e38b3e76-2900-4d57-ba6e-e758264685f3
ONBOOT=yes
NM_CONTROLLED=yes <----- change to no
BOOTPROTO=static 
IPADDR=42.0.29.8 <----- remove
NETMASK=255.255.255.0 <----- remove
NETWORK=42.0.29.0 <----- remove
BROADCAST=42.0.29.255 <----- remove
GATEWAY=42.0.29.1 <----- remove
HWADDR=00:E0:81:4F:7F:C0
DEFROUTE=yes <----- remove
PEERDNS=yes <----- remove
PEERROUTES=yes <----- remove
IPV4_FAILURE_FATAL=yes <----- remove
IPV6INIT=no <---- remove
NAME="System eth0"
BRIDGE=br0 <----- add

- In the end ifcfg-eth0 should look like this:-

DEVICE=eth0
TYPE=Ethernet
UUID=e38b3e76-2900-4d57-ba6e-e758264685f3
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
HWADDR=00:E0:81:4F:7F:C0
NAME="System eth0"
BRIDGE=br0

5. Copy the external interface backup config to the new bridge config:-
# cd /etc/sysconfig/network-scripts
# cp -avi /root/ifcfg-eth0 ifcfg-br0
# vim ifcfg-br0

- and make the following changes ( marked as <----- ):-

DEVICE=eth0 <----- change to br0
TYPE=Ethernet <----- change to Bridge
UUID=e38b3e76-2900-4d57-ba6e-e758264685f3 <----- remove
ONBOOT=yes
NM_CONTROLLED=yes <----- change to no
BOOTPROTO=static
IPADDR=42.0.29.88
NETMASK=255.255.255.0
NETWORK=42.0.29.0
BROADCAST=42.0.29.255
GATEWAY=42.0.29.1
HWADDR=00:E0:81:4F:7F:C0 <----- remove
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0" <----- change to "System br0"

- In the end ifcfg-br0 should look like this:-

DEVICE=br0
TYPE=Bridge
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=42.0.29.8
NETMASK=255.255.255.0
NETWORK=42.0.29.0
BROADCAST=42.0.29.255
GATEWAY=42.0.29.1
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System br0" 

6. Congratulations, your external bridge is now setup, all that's left is to make sure the changes are correct and restart the networking for external interface only first in a screen session (that way if anything went wrong you can still SSH to the internal interface via some other internal node/server IP).

# screen
# /etc/init.d/network restart

- Wait for the network to come back up, and once it does, verify the external bridge is up and running:

# ifconfig -a | more

br0 Link encap:Ethernet HWaddr 00:E0:81:4F:7F:C0
inet addr:42.0.29.8 Bcast:42.0.29.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:81ff:fe4f:7fc0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:76570 errors:0 dropped:0 overruns:0 frame:0
TX packets:36461 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4660724 (4.4 MiB) TX bytes:37458561 (35.7 MiB) 

eth0 Link encap:Ethernet HWaddr 00:E0:81:4F:7F:C0
inet6 addr: fe80::2e0:81ff:fe4f:7fc0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:159379 errors:0 dropped:0 overruns:0 frame:0
TX packets:100253 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:119970302 (114.4 MiB) TX bytes:42329680 (40.3 MiB)
Interrupt:18 Memory:df200000-df220000
.....

- Do simple ping tests to confirm external bridge interface works OK.
# ping google.com

7. Next configure the internal interface. Edit /etc/sysconfig/network-scripts/ifcfg-eth1 and modify the lines marked as <----- :-

DEVICE=eth1
TYPE=Ethernet
UUID=c87b908f-33cc-4889-8a00-18f9ffe71db6
ONBOOT=yes
NM_CONTROLLED=yes <----- change to no
BOOTPROTO=static
IPADDR=10.0.29.88 <----- remove
NETMASK=255.255.252.0 <----- remove
NETWORK=10.0.28.0 <----- remove
BROADCAST=10.0.31.255 <----- remove
HWADDR=00:E0:81:4F:7F:C1
DEFROUTE=yes <----- remove
PEERDNS=yes <----- remove
PEERROUTES=yes <----- remove
IPV4_FAILURE_FATAL=yes <----- remove
IPV6INIT=no
NAME="System eth1"
BRIDGE=intbr0 <----- add

- In the end ifcfg-eth1 should look like this:-

DEVICE=eth1
TYPE=Ethernet
UUID=c87b908f-33cc-4889-8a00-18f9ffe71db6
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
HWADDR=00:E0:81:4F:7F:C1
NAME="System eth1"
BRIDGE=intbr0

8. Copy the internal interface backup config to the new bridge config:-

# cd /etc/sysconfig/network-scripts
# cp -avi /root/ifcfg-eth1 ifcfg-intbr0
# vim ifcfg-intbr0

- and make the following changes ( marked as <----- ):-

DEVICE=eth1 <----- change to intbr0
TYPE=Ethernet <----- change to Bridge
UUID=c87b908f-33cc-4889-8a00-18f9ffe71db6 <----- remove
ONBOOT=yes
NM_CONTROLLED=yes <----- change to no
BOOTPROTO=static
IPADDR=10.0.29.88
NETMASK=255.255.252.0
NETWORK=10.0.28.0
BROADCAST=10.0.31.255
HWADDR=00:E0:81:4F:7F:C1 <----- remove
DEFROUTE=yes <----- remove
PEERDNS=yes <----- remove
PEERROUTES=yes <----- remove
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth1" <----- change to "System intbr0"

- In the end ifcfg-intbr0 should look like this:-

DEVICE=intbr0
TYPE=Bridge
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=static
IPADDR=10.0.29.8
NETMASK=255.255.252.0
NETWORK=10.0.28.0
BROADCAST=10.0.31.255
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System intbr0"

NOTE: Do NOT add any gateway / default router in internal interface/bridge config as this will confuse the OS and it won't route properly to the Internet.

9. Congratulations, your internal bridge is now setup, all that's left is to make sure the changes are correct and restart the networking again in a screen session.

# screen
# /etc/init.d/network restart

- Wait for the network to come back up, and once it does, verify both external and internal bridges are up and running:

# ifconfig -a | more

br0 Link encap:Ethernet HWaddr 00:E0:81:4F:7F:C0 
inet addr:42.0.29.8 Bcast:42.0.29.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:81ff:fe4f:7fc0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:76570 errors:0 dropped:0 overruns:0 frame:0
TX packets:36461 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0 
RX bytes:4660724 (4.4 MiB) TX bytes:37458561 (35.7 MiB) 

eth0 Link encap:Ethernet HWaddr 00:E0:81:4F:7F:C0 
inet6 addr: fe80::2e0:81ff:fe4f:7fc0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:159379 errors:0 dropped:0 overruns:0 frame:0
TX packets:100253 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000 
RX bytes:119970302 (114.4 MiB) TX bytes:42329680 (40.3 MiB)
Interrupt:18 Memory:df200000-df220000
.....

eth1 Link encap:Ethernet HWaddr 00:E0:81:4F:7F:C1
inet6 addr: fe80::2e0:81ff:fe4f:7fc1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:281858 errors:0 dropped:0 overruns:0 frame:0
TX packets:143664 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:403605525 (384.9 MiB) TX bytes:10431740 (9.9 MiB)
Interrupt:19 Memory:df220000-df240000

intbr0 Link encap:Ethernet HWaddr 00:E0:81:4F:7F:C1
inet addr:10.0.29.8 Bcast:10.0.31.255 Mask:255.255.252.0
inet6 addr: fe80::2e0:81ff:fe4f:7fc1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:281608 errors:0 dropped:0 overruns:0 frame:0
TX packets:143573 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:399564369 (381.0 MiB) TX bytes:10423726 (9.9 MiB)

- Do simple ping tests to confirm internal bridge interface works OK.
# ping 10.0.28.15

10. If all OK, now we need to add the bridge info into the SolusVM entry for this node.
- Log in to SolusVM
- Go to Nodes --> List Nodes
- Look for the node entry row and click on the Edit icon to edit the node entry
- Make sure the following fields are properly filled in:-
IP Address: 42.0.29.8
Internal IP Address: 10.0.29.8
Network interface: eth0
KVM bridge: br0
Internal bridge check: checked

- Next, go back to Nodes --> List Nodes and click on the node entry
- Click on "Internal Ipaddresses" menu item
- Make sure the following fields are properly filled in:-
(Under Network Settings)
Gateway: 42.0.29.1
Netmask: 255.255.252.0
Bridge: intbr0


DONE.

References:-
http://docs.solusvm.com/kvm_bridge_setup


Was this answer helpful?

« Back