Ashoke Ranjan Thakur writes:
> Hello Indra
> I am not clear about "route" command; as for Amlan's
> suggestion I do know that they are using the same ethernet
> card for aliasing both the IP address at Saha Institute. Only
> they are using Slakware ART
>
As I said before, it is possible to aliase more than one IP to a
card if that same machine is not doing any forwarding for IPs
belonging to the different nets, the IPs of which are aliased to the
same card. For an example, a normal routing table will look like -
(my routing table)
[amlan@catbert docs]$ /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags [...] Iface
137.132.163.120 * 255.255.255.255 UH eth0
137.132.163.0 * 255.255.255.0 U eth0
127.0.0.0 * 255.0.0.0 U lo
default 137.132.163.1 0.0.0.0 UG eth0
Now for a machine doing IP masquerading the normal way (with more
than one ethernet card) it will look like -
[amlan@catbert docs]$ /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags [...] Iface
192.168.1.1 * 255.255.255.255 UH eth1
192.168.1.0 * 255.255.255.0 U eth1
137.132.163.120 * 255.255.255.255 UH eth0
137.132.163.0 * 255.255.255.0 U eth0
127.0.0.0 * 255.0.0.0 U lo
default 137.132.163.1 0.0.0.0 UG eth0
When the machine will have a packet coming from the 192.168.1.x (eth1)
network, it will know by virtue of its masquerading layer that it
needs to be forwarded to the eth0 interface (the default route
resolves that.) Now the masquerading layer also keeps track of
corresponding packets coming in. Thus when a packet comes in from
an external host and which is meant for a host within the
masqueraded net, the masq layer will rewrite the packet headers with
the appropriate destination IP and re-present it to the routing
layer. The routing table then does a lookup of the table and finds
that the packet needs to be sent out the eth1 interface. Thus,
everybody is happy here.
However, if you have ONE card aliased with the two IPs, you will
have a routing table like -
[amlan@catbert docs]$ /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags [...] Iface
192.168.1.1 * 255.255.255.255 UH eth0
192.168.1.0 * 255.255.255.0 U eth0
137.132.163.120 * 255.255.255.255 UH eth0
137.132.163.0 * 255.255.255.0 U eth0
127.0.0.0 * 255.0.0.0 U lo
default 137.132.163.1 0.0.0.0 UG eth0
You should be clearly able to see that so long as there is NO
forwarding of packets (aka lookup of routing table) taking place,
things are just fine with the above config. However, the moment the
routing table lookup happens for the scenarios mentioned erstwhile,
the routing decision process is confused and the packets either
appear multiple times with different headers on the same interface,
or they don't appear at all depending on the configuration of the
routing layer.
I hope this helps.
-amlan.
--
Amlan Saha [EMAIL PROTECTED]
http://www.cwc.nus.edu.sg/~cwcamlan [EMAIL PROTECTED]
--
To unsubscribe, send mail to [EMAIL PROTECTED] with the body
"unsubscribe ilug-cal" and an empty subject line.
FAQ: http://www.ilug-cal.org/faq/listfaq.html