Re: How to specify/detect an NIC when using two or more NIC
From: Moe Trin (ibuprofin_at_painkiller.example.tld)
Date: 08/30/05
- Next message: Moe Trin: "Re: The penis is way too delicate for masturbation"
- Previous message: cyclone: "Re: Multiple NIC's. Which is used for pinging?"
- In reply to: lasseboo: "Re: How to specify/detect an NIC when using two or more NIC"
- Next in thread: Moe Trin: "Re: How to specify/detect an NIC when using two or more NIC"
- Reply: Moe Trin: "Re: How to specify/detect an NIC when using two or more NIC"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 30 Aug 2005 14:53:16 -0500
In the Usenet newsgroup comp.os.linux.networking, in article
<1125382803.000314.214100@g43g2000cwa.googlegroups.com>, lasseboo wrote:
>hi, old guy,
Hi
>no problem for me to teach you a little bit about how a modern computer
>(debian sarge based) works ... ;-)
Uhuh...
>- on my box,
>
>"route -n"
>
>...shows:
>
>Kernel IP Routentabelle
>
>Ziel Router Genmask Flags Metric Ref Use Iface
>
>1.2.23.223 1.2.23.223 255.255.255.255 UGH 0 0 0 eth0
>1.2.23.13 1.2.23.13 255.255.255.255 UGH 0 0 0 eth0
>192.168.10.0 192.168.0.3 255.255.255.254 UG 0 0 0 eth1
>192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
>1.2.22.0 0.0.0.0 255.255.254.0 U 0 0 0 eth0
>
>- you can see that there is no default route (and that i am working on
>a german system ;-) ).
That is mis-configured if your munged data is to be believed. Neither
"1.2.23.223" or "1.2.23.13" need a host route, as they are within the
network mask range of "1.2.22.0"/23. Also, using a gateway that is the
host is not needed. 'If I need to talk to "1.2.23.223", you are telling
me that I need to send the packets to "1.2.23.223", who will relay
these to "1.2.23.223", but how do I get to "1.2.23.223" in the
first place?' Remember, a "Host" route takes precedence over a "Net"
route (which in turn takes precedence over a "wider" "Net" route, and
so on).
>- now, what happened when I am adding
>
>"route add default eth0"
>
>is that the packets to hosts inside our network will take the ways i
>told them via the kernel<B4>s routingtable and every other packet is
>redirected to eth0.
That's just great. Now, set your system up exactly as you have shown, and
show us a 'traceroute -n 194.25.2.129', with and without the default route.
Use tcpdump -n to see what is going on.
Here, I can show you a similar test in the lab. (Do watch the line wrap here)
[aardvark /]# /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.151.0 0.0.0.0 255.255.255.0 U 0 0 18 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 7 lo
[aardvark /]# traceroute -n 4.3.2.1
traceroute to 4.3.2.1 (4.3.2.1) from 192.168.151.12, 30 hops max, 38 byte
packets
traceroute: sendto: Network is unreachable
1 traceroute: wrote 4.3.2.1 38 chars, ret=-1
[aardvark /]# /sbin/route add default eth0
[aardvark /]#/sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.151.0 0.0.0.0 255.255.255.0 U 0 0 18 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 7 lo
0.0.0.0 0.0.0.0 0.0.0.0 UG 0 0 0 eth0
[aardvark /]# traceroute -n 4.3.2.11
traceroute to 4.3.2.11 (4.3.2.11) from 192.168.151.12, 30 hops max, 38 byte
packets
1 * *
[aardvark /]# /usr/sbin/tcpdump -n
tcpdump: listening on eth0
12:36:15.850000 arp who-has 4.3.2.11 tell 192.168.151.12
12:37:15.850000 arp who-has 4.3.2.11 tell 192.168.151.12
12:38:15.850000 arp who-has 4.3.2.11 tell 192.168.151.12
12:39:15.850000 arp who-has 4.3.2.11 tell 192.168.151.12
Hmmm, wonder why it doesn't seem to be doing what you suggest? Would you
like to see the same trace to 194.25.2.129? I'd show it, but the results
are identical - for some reason, 194.25.2.129 isn't responding to ARP
requests. Maybe because it's not really on this same network segment. By
the way, (although 'aardvark' doesn't know it) there is a router on this
network, but because the packets don't have it's MAC address, it's ignoring
them - even though it does know how to route to the world. Also, the reason
I use 4.3.2.1 (and 4.3.2.11 - wonder how the poor sod who owns that block
feels about everyone using those addresses) is because my upstream knows
that 1.0.0.0/8 is a reserved address, and thus there can be no route to it.
Also, while 'aardvark' is running a 2.2.27-rc2 kernel when I tested this,
I can do the same thing with a 2.0.40, 2.4.32-pre2, or 2.6.13 kernel on
nearly identical systems.
>debian-box:/# route add default eth0
>
>debian-box:/# ping 194.25.2.129
>
>PING 194.25.2.129 (194.25.2.129) 56(84) bytes of data.
>64 bytes from 194.25.2.129: icmp_seq=1 ttl=54 time=22.6 ms
>64 bytes from 194.25.2.129: icmp_seq=2 ttl=54 time=20.2 ms
>
>everything looks fine.
Does it? Let's see the tcpdump -n -i eth0 of that sequence.
Do you expect to toss a letter outside your front door, and expect anyone
passing by to take it to the destination? (If so, do you pay your monthly
bills by letter - and use cash?) Or do you put the letter in the "mail box"?
Please read RFC0791, RFC0793, and RFC1180 (neither RFC0894 or RFC1042 are
very useful as guides), and explain how the packet is transferred from
your host to 194.25.2.129. Do pay attention to the headers on the 'wire'
level, using tcpdump -n.
>debian-box:/# /sbin/route add default -gw 1.2.23.250 eth0"
Hate it when I do that. Apparently like you, I don't have to use that
command very often - try
debian-box:/# /sbin/route add default gw 1.2.23.250 eth0"
>but i may be wrong; so, it<B4>s your turn ;-)
Back to you ;-)
Old guy
- Next message: Moe Trin: "Re: The penis is way too delicate for masturbation"
- Previous message: cyclone: "Re: Multiple NIC's. Which is used for pinging?"
- In reply to: lasseboo: "Re: How to specify/detect an NIC when using two or more NIC"
- Next in thread: Moe Trin: "Re: How to specify/detect an NIC when using two or more NIC"
- Reply: Moe Trin: "Re: How to specify/detect an NIC when using two or more NIC"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|