0

I am trying to configure a bridged network in a CentOS machine created with virtual box. I already did the same on two ubuntu 12.04 machines, and this is how the /etc/network/interfaces file looks like:

auto lo
iface lo inet loopback
auto eth0
iface eth0 inet manual
auto br0
iface br0 inet dhcp
    bridge_ports eth0
    bridge_stp off
    bridge_fd 0
    bridge_maxwait 0

This way on the ubuntu machine, the IP address 192.168.0.x is associated with the br0 interface:

enter image description here

Instead on the CentOS machine that IP address is still associated with the eth0 interface:

enter image description here

This makes me think that I'm still missing something in the network configuration. But the problem is that there isn't such file as /etc/network/interface in CentOS, instead there is /etc/sysconfig/network-scripts/ifcfg-br0, but the syntax is totally different. Does anyone know how to do the same in CentOS?

1

Change following configuration to your needs.

vim /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
DNS1=192.168.0.1
GATEWAY=192.168.0.1
IPADDR=192.168.0.100
NETMASK=255.255.255.0
ONBOOT=yes
SEARCH=”example.com”

Modify eth0 configuration:

vim /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=00:1e:90:f3:f0:02
ONBOOT=yes
TYPE=Ethernet
IPV6INIT=no
USERCTL=no
BRIDGE=br0
  • Just one question: why the netmask is 255.255.255.0? I though it was 255.255.0.0. This is what I read in RFC 1918: 192.168.0.0 - 192.168.255.255 (192.168/16 prefix) – Ramy Al Zuhouri May 29 '15 at 11:35
  • you can put the mask what ever you want it's just an example in my Virtual network – Wissam Roujoulah May 29 '15 at 11:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.