5

ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:25:90:60:1B:FC  
          inet addr:10.0.47.42  Bcast:10.255.255.255  Mask:255.255.255.248
          inet6 addr: fe80::225:90ff:fe60:1bfc/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4300 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:416886 (407.1 KiB)  TX bytes:812 (812.0 b)
          Memory:fbce0000-fbd00000 

eth1      Link encap:Ethernet  HWaddr 00:25:90:60:1B:FD  
          inet addr:72.9.239.194  Bcast:72.255.255.255  Mask:255.255.255.248
          inet6 addr: fe80::225:90ff:fe60:1bfd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:82334 errors:0 dropped:0 overruns:0 frame:0
          TX packets:53868 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:85116034 (81.1 MiB)  TX bytes:22357038 (21.3 MiB)
          Memory:fbde0000-fbe00000 

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:16436  Metric:1
          RX packets:5356 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5356 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:674981 (659.1 KiB)  TX bytes:674981 (659.1 KiB)

Adresses assigned to server should be 5 usable:

72.9.239.194
72.9.239.195
72.9.239.196
72.9.239.197
72.9.239.198

Unfortunately when I do ping server answers only on: 72.9.239.194

OS=centOS 6/64bit

What could be wrong ?

4
  • 1
    How did you assign the other addresses?
    – uSlackr
    Sep 26, 2011 at 20:35
  • 3
    It doesn't look like those interfaces are configured. What are the results of an ifconfig -a?
    – user62491
    Sep 26, 2011 at 20:35
  • I added full ifconfig -a in the post
    – chubbyk
    Sep 26, 2011 at 20:41
  • Please note that ifconfig is deprecated. Stop using it. In the example above, all 5 addresses may be assigned to eth1, yet ifconfig won't show them. ip will.
    – MikeyB
    Oct 18, 2011 at 17:49

4 Answers 4

13

You need to configure those IPs on that interface.

ip addr add 72.9.239.195/29 dev eth1
ip addr add 72.9.239.196/29 dev eth1
ip addr add 72.9.239.197/29 dev eth1
ip addr add 72.9.239.198/29 dev eth1

You can also use the ifcfg-eth1:n files in /etc/sysconfig/network-scripts to make this configuration last across reboots.

See Red Hat's documentation for more information.

5

From that output.. you only have 1 IP on the interface. You have been assigned that block but you have to alias the other IPs to that interface.

You can see if you have them aliased via

ip address show

quick and old way is using ifconfig to add aliases

ifconfig eth1:1 72.9.239.195 netmask 255.255.255.0

Same command for the other IPs.

2
  • 2
    I think your netmask should be 255.255.255.248.
    – dmourati
    Sep 26, 2011 at 20:43
  • If I use the command you mentioned .. will it stay there after reboot ?
    – chubbyk
    Sep 26, 2011 at 20:51
0

Even if your IPs are set up properly, the server may still answer on 72.9.239.194 because that's the primary IP on that interface. And, just to really wreck your head, if the server's default route is via, say, 72.9.239.193 and you send a ping to eth0 (10.0.47.42) from a device in another subnet - let's say 10.11.0.0/24 - there's a good chance that the server will respond to that packet from 72.9.239.194! This last assumes you don't have a more specfic route to 10.11.0.0/24 via a gateway on 10.0.47.0/24.

Don't read too much into the address that responds to your pings - as long as the device responds and the replies are from an address that's configured on it, you're golden.

0

You need to create one file per secondary IP in your /etc/sysconfig/network-scripts/ folder. Each interface is represented by a file corresponding to ifcfg-eth where represents the unique interface number for that card (e.g. the first interface card is represented by ifcfg-eth0).

To create an alias for that interface, you need to create a file in the format of ifcfg-eth0: where represents the alias number (e.g. the 2nd ip for the first card would be ifcfg-eth0:1).

So in your case you currently should have a file named ifcfg-eth1 (containing the configuration for IP 72.9.239.194) and so you need to create 4 files named ifcfg-eth1:1, ifcfg-eth1:2, ifcfg-eth1:3 and ifcfg-eth1:4 with the following content:

DEVICE=eth1:1
BOOTPROTO=none
ONPARENT=yes
IPADDR=72.9.239.195
NETMASK=255.255.255.248
BROADCAST=72.9.239.255

(just change the DEVICE name and IPADDR on each file correspondingly - everything else remains the same on all 4 files).

Also on your file ifcfg-eth1 your BROADCAST address seems to be false. The correct one should be 72.9.239.255.

Create the 4 files, and issue a /etc/init.d/network restart or simply restart your whole server for the IP address aliases to load up.

You must log in to answer this question.

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