-1

Hello i have just installed CenOSs 6.6 on ESXi 5.5 and I have eth0 working fine. I have internet access and I want to assign a second IP in CentOS. So purchased another ip from oneprovider.com and was given another failover IP. I want to assign this in CentOS 6.6 but the problem is the new IP address has a different hardware mac address and I am not aware how to set this up and would be great if someone can help me out.

Thanks for your answer (Ricardo) i have tried what you said but the second ip is not ping and does not work please check the eth0 and eth0:0 files content for the server

DEVICE=eth0
TYPE=Ethernet
UUID=902acf30-e33f-4baf-a3fd-5168daefbb92
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=none
IPADDR=195.154.37.164
PREFIX=32
GATEWAY=62.210.203.1
DNS1=62.210.16.6
DNS2=62.210.16.7
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System eth0"
HWADDR=00:50:56:00:65:44

and the contents of eth0:0

DEVICE=eth0:0
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
NM_CONTROLLED="no"
IPADDR=195.154.33.75
NETMASK=255.255.255.255
BROADCAST=195.154.33.75
NETWORK=62.210.203.1
NOZEROCONF=yes

and it is not working the ip used in eth0:0 has a different mac adress as provided by oneprovider.com check this picture for the mac address info and let me know how i can have 2 ip address in this server i can reconfigure the server via vsphere and add another nic will that enable me to have 2 ip.

here is link for the picture of ip details. http://oi57.tinypic.com/29pvgwg.jpg

please check and let me know.

Please let me know asap and thanks very much for your awesome help.

here is the output of ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:50:56:00:65:44
          inet addr:195.154.37.164  Bcast:195.154.37.164  Mask:255.255.255.255
          inet6 addr: fe80::250:56ff:fe00:6544/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3104 errors:0 dropped:0 overruns:0 frame:0
          TX packets:382 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:286616 (279.8 KiB)  TX bytes:51248 (50.0 KiB)

eth0:0    Link encap:Ethernet  HWaddr 00:50:56:00:65:44
          inet addr:195.154.33.75  Bcast:195.154.33.75  Mask:255.255.255.255
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

eth2      Link encap:Ethernet  HWaddr 00:50:56:00:6E:1C
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

and the output of route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
62.210.203.1    0.0.0.0         255.255.255.255 UH    0      0        0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U     1002   0        0 eth0
0.0.0.0         62.210.203.1    0.0.0.0         UG    0      0        0 eth0
5
  • Where is the server hosted?
    – ewwhite
    Feb 9, 2015 at 0:29
  • it is hosted in paris with oneprovider
    – Samuel
    Feb 9, 2015 at 12:18
  • Does your provider give you an option for a hardware firewall or out-of-band access?
    – ewwhite
    Feb 9, 2015 at 13:28
  • after bringing up eth0:0 with the 'ifup eth0:0' command what is the output of the 'ifconfig -a' command and 'route -n'? Also get rid of the NETWORK statement on eth0:0, it does not make any sense.
    – Ricardo
    Feb 10, 2015 at 1:16
  • hi ricardo i have added the output for these two commands above please check again let me thank you for your awesome help.
    – Samuel
    Feb 10, 2015 at 1:43

1 Answer 1

0

All you would need to do is to add a new script with the name eth0:0

For example:

This would be the eth0 one:

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
HWADDR="D4:BE:D9:D2:FB:E4"
BOOTPROTO=static
ONBOOT="yes"
IPADDR=192.168.1.49
NETMASK=255.255.255.0
BROADCAST=192.168.1.255
NETWORK=192.168.1.0
NOZEROCONF=yes

...and this would be your seconday IP at eth0:0

# cat /etc/sysconfig/network-scripts/ifcfg-eth0:0
DEVICE=eth0:0
BOOTPROTO=static
ONBOOT=yes
TYPE=Ethernet
NM_CONTROLLED="no"
IPADDR=172.22.48.226
NETMASK=255.255.255.248
BROADCAST=172.22.48.231
NETWORK=172.22.48.224
NOZEROCONF=yes

After its done, just bring it up with

ifup eth0:0

Make note that in my example the secondary IP is not controlled by NetworkManager, hence the NM_CONTROLLED="no". You don't need to tie it up with a another MAC address, it should work fine without the HWADDR line.

1
  • hi thanks very much for your awesome help, i tried this and it didn't work. i have updated my post above please check and let me know how to make it work. once again thanks for your awesome help.
    – Samuel
    Feb 10, 2015 at 1:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .