Hi all,
I've just install CentOS 6 on VirtualBox. I have three interfaces: lo, eth0, eth1. I'ld like to have a static ipv4 address for eth1 interface. In directory /etc/sysconfig/network-scripts I create a new file calls ifcfg-eth1. (Before that operation only ifcfg-lo exist). File ifcfg-eth1 looks like:
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
NETWORK=192.168.3.0
NETMASK=255.255.255.0
IPADDR=192.168.3.3
USERCTL=no
When I reboot CentOS, eth0 and eth1 have the same ipv4 address -> 192.168.3.3 . Eth1 is connected to nat and when i called dhclient eth0 then to the interface eth0 was added address from server dhcp (on virtualbox). Why in that configuration which is above address 192.168.3.3 is added to eth0 interface. When file ifcfg-eth1 doesn't exist then none interface have that address.
P.S.
Sorry for my poor English.
Static ip address on two interfaces.
Re: Static ip address on two interfaces.
What if you do create both ifcfg-eth0 and ifcfg-eth1?
Re: Static ip address on two interfaces.
[quote]
jlehtone wrote:
What if you do create both ifcfg-eth0 and ifcfg-eth1?[/quote]
I've created both but ifcfg-eth0 has another ipv4 address and when i reboot CentOS then end effect is the same as above. Both have 192.168.3.3
jlehtone wrote:
What if you do create both ifcfg-eth0 and ifcfg-eth1?[/quote]
I've created both but ifcfg-eth0 has another ipv4 address and when i reboot CentOS then end effect is the same as above. Both have 192.168.3.3
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
Static ip address on two interfaces.
Welcome to the CentOS fora. Please see the recommended reading for new users linked in my signature.
I suspect this is another effect of the change [url=http://wiki.centos.org/FAQ/General?highlight=%28TUV%29#head-d29a2b7e61ffc544973098f9dd49fe4663efba50]TUV[/url] made to use NetworkManager by default rather than the network service. It seems to cause a lot of confusion and conflicts. I believe you should either disable NetworkManager and insert a line[code]NM_CONTROLLED="no"[/code]in each configuration, or use nm-applet to configure both interfaces.
I suspect this is another effect of the change [url=http://wiki.centos.org/FAQ/General?highlight=%28TUV%29#head-d29a2b7e61ffc544973098f9dd49fe4663efba50]TUV[/url] made to use NetworkManager by default rather than the network service. It seems to cause a lot of confusion and conflicts. I believe you should either disable NetworkManager and insert a line[code]NM_CONTROLLED="no"[/code]in each configuration, or use nm-applet to configure both interfaces.