I am trying to configure a Public(Static) IP in Cent OS 6.4. For this, I made a copy of eth0(added local IP, so that I can connect the system to Internet) and named it to eth0:0(added Public IP, so that the system can be accessible via SSH).

After restarting the network devices, am still not able to get the required result.

I want to access this system via SSH with the configured public IP.

ifconfig -a

eth0      Link encap:Ethernet  HWaddr EC:A1:6B:7B:89:2C  
          inet addr:  Bcast:  Mask:
          inet6 addr: fe80::eeb8:6bff:fr7b:892c/64 Scope:Link
          RX packets:540549 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11533 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:65591743 (62.5 MiB)  TX bytes:1079767 (1.0 MiB)

lo        Link encap:Local Loopback  
          inet addr:  Mask:
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:480 (480.0 b)  TX bytes:480 (480.0 b) }


  • Tell us about your network situation. How are things connected to the internet?
    – EEAA
    Mar 21 '14 at 11:21
  • Also, can you cut-and-paste the output of ifconfig -a, and the contents of /etc/sysconfig/network-scripts/ifcfg-eth0:0 into your question?
    – MadHatter
    Mar 21 '14 at 11:22
  • have updated with the details but can't share the Public IPs. Mar 21 '14 at 11:41
  • @MadHatter should be an answer
    – JamesRyan
    Mar 21 '14 at 12:11

Have you tried changing DEVICE=eth0 to DEVICE=eth0:0 in ifcfg-eth0:0? Also, remove the HWADDR and GATEWAY lines; you can't have more than one default gateway.

There may be a more fundamental issue here; we can help you get the ip address on to the virtual interface, but if you don't have the networking infrastructure in place to service that address, not much will come of this.

  • I have changed the DEVICE name and removed HWADDR and GATEWAY from ifcfg-eth0:0. But still it is not working. ifcfg-eth0 is directly connected to the Internet which makes the Internet working. I was looking for a solution which can help me access this machine remotely via SSH. Mar 24 '14 at 11:09
  • What happened when you did ifup eth0:0?
    – MadHatter
    Mar 24 '14 at 11:13
  • That's working, then. The external IP address is applied to the interface alias, as you asked for.
    – MadHatter
    Mar 24 '14 at 11:16
  • Its up but not able to ping as its the public IP. Mar 24 '14 at 11:18
  • As I said, you'll need to make sure that your network topology supports having that address on that interface before it has any chance of working. You'll also need to sort out routing, NAT, and the like. They are all outside the scope of this question, and moreover, the question has been closed by the community.
    – MadHatter
    Mar 24 '14 at 11:21

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