Aliasing different IP blocks to same NIC

From: Lane Vance (lane_at_abetterway.net)
Date: 08/28/03


Date: 28 Aug 2003 12:42:11 -0700

Hello all,

I have two different blocks of IPs that have different gateways and
netmasks and want to alias them all to one NIC. I run RH 8.0 with the
following in /etc/sysconfig/network-scripts:

ifcfg-eth0:
DEVICE=eth0
BOOTPROTO=static
BROADCAST=64.71.173.255
IPADDR=64.71.173.98
NETMASK=255.255.255.0
NETWORK=64.71.173.0
ONBOOT=yes

ifcfg-eth0-range1:
DEVICE=eth0
BOOTPROTO=static
BROADCAST=64.71.173.255
GATEWAY=64.71.173.1
NETMASK=255.255.255.0
NETWORK=64.71.173.0
IPADDR_START=64.71.173.112
IPADDR_END=64.71.173.114
CLONENUM_START=0
ONBOOT=yes

ifcfg-eth0-range2:
DEVICE=eth0
BOOTPROTO=static
BROADCAST=64.71.153.175
GATEWAY=64.71.153.169
NETMASK=255.255.255.248
NETWORK=64.71.153.168
IPADDR_START=64.71.153.170
IPADDR_END=64.171.153.174
CLONENUM_START=3
ONBOOT=yes

Everything in ifcfg-eth0 and ifcfg-eth0-range1 comes up and works
fine. However, ifcfg-eth0-range2 does not come up. When I restart
networking all looks good:

# service network restart
Shutting down interface eth0: [ OK ]
Shutting down loopback interface: [ OK ]
Setting network parameters: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
Bringing up interface eth0-range1: [ OK ]
Bringing up interface eth0-range2: [ OK ]

but an ifconfig shows the range2 never came up:

# ifconfig
eth0 Link encap:Ethernet HWaddr 00:10:DC:9D:B1:5E
          inet addr:64.71.173.98 Bcast:64.71.173.255
Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:169702616 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1812188 errors:0 dropped:0 overruns:4 carrier:0
          collisions:0 txqueuelen:100
          RX bytes:209475325 (199.7 Mb) TX bytes:1468565801 (1400.5
Mb)
          Interrupt:11 Base address:0x7000

eth0:0 Link encap:Ethernet HWaddr 00:10:DC:9D:B1:5E
          inet addr:64.71.173.112 Bcast:64.71.173.255
Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          Interrupt:11 Base address:0x7000

eth0:1 Link encap:Ethernet HWaddr 00:10:DC:9D:B1:5E
          inet addr:64.71.173.113 Bcast:64.71.173.255
Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          Interrupt:11 Base address:0x7000

eth0:2 Link encap:Ethernet HWaddr 00:10:DC:9D:B1:5E
          inet addr:64.71.173.114 Bcast:64.71.173.255
Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          Interrupt:11 Base address:0x7000

lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:89351 errors:0 dropped:0 overruns:0 frame:0
          TX packets:89351 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:117677790 (112.2 Mb) TX bytes:117677790 (112.2 Mb)

Any help anyone can offer will be greatly appreciated.

TIA,
Lane



Relevant Pages

  • Re: network card not detected in rhel 5
    ... Pls find the location of the driver, download and try loading the driver. ... RE: NIC Teaming ... In the interface that you want as part of the bond edit the appropriate ... ifcfg-eth0 and ifcfg-eth1 as bonding manipulates these values to make ...
    (RedHat)
  • Re: The mystery of WiFi
    ... tried to bring up the interface <xyz> ... I have an ifcfg-eth0 which is completely ignored ... in particular it does not work with my Orinoco PCMCIA cards, ... in the ifcfg-eth0 file. ...
    (Fedora)
  • Re: NIC Teaming
    ... specifically because that helps to tie down interface so they are always ... files (ifcfg-eth0, ifcfg-eth1, etc.) should look like this: ... 17 * ifconfig bond0 ipaddress netmask up ... The hw mac address will come from ...
    (RedHat)
  • Networking Bridging
    ... In FC4, I just added a couple lines to ifcfg-eth0 and ifcfg-eth1 and created a ifcfg-br0 file and it'd work, but in FC5, those same steps aren't working. ... I don't have a clue how to go about debugging what's going on (I've tried to look into it, but the number of different files and programs involved in starting the network is too much for me to handle). ... If I follow the tutorial given at http://www.linuxjournal.com/article/8172 for setting up a bridge manually, ... Bringing up interface br0: Device br0 does not seem to be present, ...
    (Fedora)
  • Re: The mystery of WiFi
    ... tried to bring up the interface <xyz> ... I have an ifcfg-eth0 which is completely ignored ... in the ifcfg-eth0 file. ... I'm pretty sure I tried "ifup eth0" in this case, ...
    (Fedora)