- Aliasing different IP blocks to same NIC

PDA

View Full Version : Aliasing different IP blocks to same NIC


Lane Vance
07-24-2004, 09:02 PM
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

Lane Vance
07-24-2004, 09:02 PM
I found my typo in the ifcfg-etho-range2 file. Now all the IPs show
up with an ifconfig with no errors but it does not seem like they are
really aliased as I cannot ping them remotely (locally ping works). I
must have missed something - any clues are appreciated:

# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref
Use Iface
64.71.153.168 * 255.255.255.248 U 0 0
0 eth0
64.71.173.96 * 255.255.255.248 U 0 0
0 eth0
64.71.173.0 * 255.255.255.0 U 0 0
0 eth0
127.0.0.0 * 255.0.0.0 U 0 0
0 lo
default 64.71.153.169 0.0.0.0 UG 0 0
0 eth0
default 64.71.173.1 0.0.0.0 UG 0 0
0 eth0
default 64.71.173.1 0.0.0.0 UG 0 0
0 eth0
default 64.71.173.1 0.0.0.0 UG 0 0
0 eth0
default 64.71.173.1 0.0.0.0 UG 0 0
0 eth0
default 64.71.173.1 0.0.0.0 UG 0 0
0 eth0
default 64.71.173.1 0.0.0.0 UG 0 0
0 eth0
default 64.71.173.1 0.0.0.0 UG 0 0
0 eth0
default 64.71.173.1 0.0.0.0 UG 0 0
0 eth0
default 64.71.173.1 0.0.0.0 UG 1 0
0 eth0
default 64.71.173.1 0.0.0.0 UG 1 0
0 eth0
default 64.71.173.1 0.0.0.0 UG 1 0
0 eth0
default 64.71.173.1 0.0.0.0 UG 1 0
0 eth0
default 64.71.153.169 0.0.0.0 UG 1 0
0 eth0
default 64.71.173.1 0.0.0.0 UG 1 0
0 eth0
default 64.71.173.1 0.0.0.0 UG 1 0
0 eth0
default 64.71.173.1 0.0.0.0 UG 1 0
0 eth0


# 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:287833 errors:0 dropped:0 overruns:0 frame:0
TX packets:10631 errors:0 dropped:0 overruns:1 carrier:0
collisions:0 txqueuelen:100
RX bytes:17417820 (16.6 Mb) TX bytes:12559545 (11.9 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

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

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

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

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

eth0:7 Link encap:Ethernet HWaddr 00:10:DC:9D:B1:5E
inet addr:64.71.153.174 Bcast:64.71.153.175
Mask:255.255.255.248
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:36 errors:0 dropped:0 overruns:0 frame:0
TX packets:36 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2999 (2.9 Kb) TX bytes:2999 (2.9 Kb)






lane@abetterway.net (Lane Vance) wrote in message news:<774de041.0308281142.62ea229f@posting.google.com>...
> 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