Matt Mossholder on 13 Oct 2010 21:06:37 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Another network question


On Wed, Oct 13, 2010 at 6:10 PM, Doug Crompton <doug@crompton.com> wrote:

Question regarding multiple IP addresses on the same interface. This is on
an NSLU2 (which does not matter) using Debian Lenny

I want to assign two address ranges, one in 192.168.0.x and the other in
192.168.11.x ranges. The basic setup looks like this....


# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static
address 192.168.0.78
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.10

dns-nameservers 192.168.0.2
dns-search example.org


I then added the 192.168.11.x with....

ifconfig eth0:1 up 192.168.11.0 netmask 255.255.255.0


and got......


LKG66450E:/home/doug# ifconfig
eth0 Â Â ÂLink encap:Ethernet ÂHWaddr 00:14:bf:66:45:0e
    Âinet addr:192.168.0.78 ÂBcast:192.168.0.255 ÂMask:255.255.255.0
    Âinet6 addr: fe80::214:bfff:fe66:450e/64 Scope:Link
    ÂUP BROADCAST RUNNING MULTICAST ÂMTU:1500 ÂMetric:1
    ÂRX packets:116879 errors:0 dropped:0 overruns:0 frame:0
    ÂTX packets:101426 errors:0 dropped:0 overruns:0 carrier:0
    Âcollisions:0 txqueuelen:100
    ÂRX bytes:19413823 (18.5 MiB) ÂTX bytes:16806791 (16.0 MiB)

eth0:1 Â ÂLink encap:Ethernet ÂHWaddr 00:14:bf:66:45:0e
    Âinet addr:192.168.11.78 ÂBcast:192.168.11.255
    ÂMask:255.255.255.0
    ÂUP BROADCAST RUNNING MULTICAST ÂMTU:1500 ÂMetric:1

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:177 errors:0 dropped:0 overruns:0 frame:0
    ÂTX packets:177 errors:0 dropped:0 overruns:0 carrier:0
    Âcollisions:0 txqueuelen:0
    ÂRX bytes:17824 (17.4 KiB) ÂTX bytes:17824 (17.4 KiB)

LKG66450E:/home/doug# route
Kernel IP routing table
Destination   Gateway     Genmask     Flags Metric Ref  ÂUse
Iface
localnet    Â*        255.255.255.0  U   0   Â0    Â0
eth0
192.168.11.0 Â Â* Â Â Â Â Â Â Â 255.255.255.0 Â U Â Â 0 Â Â Â0 Â Â Â Â0
eth0
default     192.168.0.10  Â0.0.0.0     UG  Â0   Â0    Â0
eth0


My question is can I have more than one default route. One associated with
the 192.168.0.x block and another associated with the 192.168.11.x block?
I want any traffic originating with IP addresses in the 192.168.11.x block
with a destination address outside of that range to go to 192.168.11.1
and originating traffic with an IP address in the 192.168.0.x range and
a destination outside of that range to go to 192.168.0.10


And why do I want to do this you ask? Well the NSLU2 only has console
connection via ethernet. If you you don't have connection via ethernet you
don't have any connection to the box. I want to take this between two
systems that are on different 192.168.x subnets. I don't want to have to
redefine another computers IP each time so I can change it. Perhaps there
is a better way or no way to do this. Just asking!

Doug


Look here, at the section on ISP Split Access:


ÂÂ --Matt
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug