I have a /26 static ip in my network and I want to assign a second ip to a machine which already have one ip on eth0. The OS CentOS 6.6 64bit.
I added another ethernet adapter (card) to the machine and removed the 70-persistent-net.rules so network cards can be detected and added automatically after reboot. Rebooted the OS and ran ifup eth1:
root@host [~]# ifup eth1 /sbin/ifup: configuration for eth1 not found. Usage: ifup
So I made a copy of ifcfg-eth0 to ifcfg-eth1 and replaces eth0 to eth1 and hardware id (mac).
Content of ifcfg-eth1:
HWADDR=00:50:56:be:57:c2
NAME=eth1
GATEWAY=xxx.xxx.xxx.1
DNS1=8.8.8.8
DNS2=8.8.4.4
DOMAIN=Google.com
DEVICE=eth1
ONBOOT=yes
USERCTL=no
BOOTPROTO=static
NETMASK=255.255.255.192
IPADDR=xxx.xxx.xxx.5
PEERDNS=no
IPV6INIT=no
check_link_down() {
return 1;
}
Content of ifcfg-eth0:
HWADDR=00:50:56:be:7b:88
NAME=eth0
GATEWAY=81.17.30.1
DNS1=8.8.8.8
DNS2=8.8.4.4
DOMAIN=Google.com
DEVICE=eth0
ONBOOT=yes
USERCTL=no
BOOTPROTO=static
NETMASK=255.255.255.192
IPADDR=81.17.30.37
PEERDNS=no
IPV6INIT=no
check_link_down() {
return 1;
}
and ran service network restart:
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Determining if ip address xxx.xxx.xxx.37 is already in use for device eth0...
[ OK ]
Bringing up interface eth1: Determining if ip address xxx.xxx.xxx.5 is already in use for device eth1...
[ OK ]
xxx.xxx.xxx.37 is still up but xxx.xxx.xxx.5 is not responding. Did I do anything wrong?