Networking Forums

Networking Forums > Computer Networking > Linux Networking > Can't send packets via WiFi (possibly route issue)

Reply
Thread Tools Display Modes

Can't send packets via WiFi (possibly route issue)

 
 
OtisUsenet
Guest
Posts: n/a

 
      01-16-2005, 01:49 AM
Hello,

Problem:
I have eth0 and eth1 (WiFi) and can't get packets over eth1 into 'the
wild'.
I suspect the problem is with the routes, but I can't figure out how
to set them.

Machine, OS, kernel:
ThinkPad T42, Fedora Core 3, kernel 2.6.9-1.667.

Routing table right after bringing up the network (both interfaces up):

Destination Gateway Genmask Flags Metric Ref Use
Iface
192.168.0.0 * 255.255.255.0 U 0 0 0
eth0
192.168.0.0 * 255.255.255.0 U 0 0 0
eth1
169.254.0.0 * 255.255.0.0 U 0 0 0
eth1
default 192.168.0.1 0.0.0.0 UG 0 0 0
eth0

Pinging my router/gateway:
# ping 192.168.0.1 -I eth1
PING 192.168.0.1 (192.168.0.1) from 192.168.0.3 eth1: 56(84) bytes of
data.
>From 192.168.0.3 icmp_seq=1 Destination Host Unreachable


Adding a default route for eth1 doesn't help - still can't ping my
router:
# route add default gw 192.168.0.1 eth1

Trying to delete all default routes and add default routes for both
eth0 and eth1, but using 'metric 1' and 'metric 2':
# route del default
# route add default gw 192.168.0.1 metric 1 eth0
# route add default gw 192.168.0.1 metric 2 eth1
# route
Destination Gateway Genmask Flags Metric Ref Use
Iface
192.168.0.0 * 255.255.255.0 U 0 0 0
eth0
192.168.0.0 * 255.255.255.0 U 0 0 0
eth1
169.254.0.0 * 255.255.0.0 U 0 0 0
eth1
default 192.168.0.1 0.0.0.0 UG 1 0 0
eth0
default 192.168.0.1 0.0.0.0 UG 2 0 0
eth1

Trying to ping over eth1 again:
# ping 192.168.0.1 -I eth1
PING 192.168.0.1 (192.168.0.1) from 192.168.0.3 eth1: 56(84) bytes of
data.
>From 192.168.0.3 icmp_seq=1 Destination Host Unreachable


Trying to traceroute:
# traceroute 192.168.0.1 -i eth1
traceroute to 192.168.0.1 (192.168.0.1), 30 hops max, 38 byte packets
1 192.168.0.3 (192.168.0.3) 3000.383 ms !H 3002.252 ms !H 3000.644
ms !H


Uh, and this is where I run out of ideas...............
Does anyone see anything wrong in the above routing table?

The suspicious thing is that this works for eth0:

# route
Destination Gateway Genmask Flags Metric Ref Use
Iface
192.168.0.0 * 255.255.255.0 U 0 0 0
eth0
169.254.0.0 * 255.255.0.0 U 0 0 0
eth0
default 192.168.0.1 0.0.0.0 UG 0 0 0
eth0

While the same thing, but for eth1, does _not_ work for eth1:

# route
Destination Gateway Genmask Flags Metric Ref Use
Iface
192.168.0.0 * 255.255.255.0 U 0 0 0
eth1
169.254.0.0 * 255.255.0.0 U 0 0 0
eth1
default 192.168.0.1 0.0.0.0 UG 0 0 0
eth1

Perhaps the problem is not in my routing table?


Here is what ifconfig and iwconfig show:

[root@localhost otis]# ifconfig eth1
eth1 Link encap:Ethernet HWaddr 00:0C:F1:59:B4:3D
inet addr:192.168.0.3 Bcast:192.168.0.255
Mask:255.255.255.0
inet6 addr: fe80::20c:f1ff:fe59:b43d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:675 dropped:203 overruns:0 frame:0
TX packets:986 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:39240 (38.3 KiB)
Interrupt:11 Base address:0x6000 Memory:c0214000-c0214fff

[root@localhost otis]# /sbin/iwconfig eth1
eth1 IEEE 802.11b ESSID:"WirelessFoo"
Nickname:"localhost.localdomain"
Mode:Managed Frequency:2.412GHz Access Point:
00:09:5B:29:41:3F
Bit Rate=11Mb/s Tx-Powerff
Retryn RTS thrff Fragment thrff
Encryption key:1234-4567-4243-4331-3142-0000-00 Security
modepen
Power Managementff
Link Quality=99/100 Signal level=-35 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:472 Missed beacon:2


Any help would be very much appreciated.
I have wireless speakers in my home, but can't get a simple WiFi NIC to
work.... that's backwards.

Thank you.

P.S.
If you have a working eth0/eth1 combination, could you please post your
routing table, so I can at least see if the problem is indeed in
routes, or elsewhere.

 
Reply With Quote
 
 
 
 
Trygve Selmer
Guest
Posts: n/a

 
      01-16-2005, 04:11 AM
OtisUsenet wrote:
> Hello,
>
> Problem:
> I have eth0 and eth1 (WiFi) and can't get packets over eth1 into 'the
> wild'.
> I suspect the problem is with the routes, but I can't figure out how
> to set them.
>
> Routing table right after bringing up the network (both interfaces up):
>
> Destination Gateway Genmask Flags Iface
> 192.168.0.0 * 255.255.255.0 U eth0
> 192.168.0.0 * 255.255.255.0 U eth1
> 169.254.0.0 * 255.255.0.0 U eth1
> default 192.168.0.1 0.0.0.0 UG eth0


Normally you want to connect different networks to different NICs, in
your case 192.168.0.0/24 to eth0 and 192.168.1.0/24 to eth1.

You say your ip on eth1 is 192.168.0.3, what is the ip on eth0 ?

If you want the same network (here 192.168.0.0/24) connected to two
NICs, you will have to enable bridging support in the kernel.

I'll recommend you read a nice book on networking, you should also check
for networking/routing HOWTOs.

 
Reply With Quote
 
Floyd L. Davidson
Guest
Posts: n/a

 
      01-16-2005, 12:24 PM
"OtisUsenet" <(E-Mail Removed)> wrote:
>Hello,
>
>Problem:
>I have eth0 and eth1 (WiFi) and can't get packets over eth1 into 'the
>wild'.
>I suspect the problem is with the routes, but I can't figure out how
>to set them.


You haven't said what you want it to do...

Given this is a laptop, you'll want to be able to use either a
10baseT wired link or the wireless link. There are only big
problems if you want to use both at once, because then you have
to decide which traffic goes to which interface.

Also realize that you'll necessarily have to assign a different
host name to each interface if both are to be used at once.

>Machine, OS, kernel:
>ThinkPad T42, Fedora Core 3, kernel 2.6.9-1.667.
>
>Routing table right after bringing up the network (both interfaces up):
>
>Destination Gateway Genmask Flags Metric Ref Use
>Iface
>192.168.0.0 * 255.255.255.0 U 0 0 0
>eth0


This entry sends all 192.168.0.x traffic to eth0. (Where x is
any valid address.) The way you determine that is by masking
(OR'ing) the destination address with the Genmask listed above,
and if the result matches the "Destination Iface" address on
that line, that is where the traffic will go. Basically a mask
of 255 means it must match exactly, and 0 means anything
matches (and we can ignore other possible masks!)

>192.168.0.0 * 255.255.255.0 U 0 0 0
>eth1


This entry would do the same as the above, but send it to eth1.
Except it has already been routed to eth0. Hence this entry has
no effect.

>169.254.0.0 * 255.255.0.0 U 0 0 0
>eth1


This will send all traffic for any 169.254.x.x address to eth1.

>default 192.168.0.1 0.0.0.0 UG 0 0 0
>eth0


This sends all traffic not otherwise routed to the 192.158.0.1
gateway via eth0.

....

>The suspicious thing is that this works for eth0:


You can see (at least one reason) why it isn't working. But
what you have here indicates another problem:

># route
>Destination Gateway Genmask Flags Metric Ref Use
>Iface
>192.168.0.0 * 255.255.255.0 U 0 0 0
>eth0


All 192.168.0.x traffic goes to eth0.

>169.254.0.0 * 255.255.0.0 U 0 0 0
>eth0


All 169.254.x.x traffic goes to eth0.

>default 192.168.0.1 0.0.0.0 UG 0 0 0
>eth0


Everything else is sent to the gateway at 192.168.0.1, via eth0.
It certainly *should* work!

>While the same thing, but for eth1, does _not_ work for eth1:
>
># route
>Destination Gateway Genmask Flags Metric Ref Use
>Iface
>192.168.0.0 * 255.255.255.0 U 0 0 0
>eth1
>169.254.0.0 * 255.255.0.0 U 0 0 0
>eth1
>default 192.168.0.1 0.0.0.0 UG 0 0 0
>eth1
>
>Perhaps the problem is not in my routing table?


That should work just fine, as far as this particular host is
concerned. But the question is, if eth1 is a wireless device...
what does it connect to? *That* device has to be able to route
all of these addresses to your wired LAN, and it appears that it
does not.

>Here is what ifconfig and iwconfig show:
>
>[root@localhost otis]# ifconfig eth1
>eth1 Link encap:Ethernet HWaddr 00:0C:F1:59:B4:3D
>inet addr:192.168.0.3 Bcast:192.168.0.255


For a number of reasons, I'd suggest that you separate your
wired and wireless networks onto different subnets. It makes
routing a lot easier. For example, use 192.168.0.x addresses
for the wired network, and 192.168.1.x addresses for the
wireless network. (I so something like that, and then use names
that are easy, for me at least, to match up. For example, my
laptop's 10baseT interface is named "natchik", which is an
Inupiat Eskimo word for "seal", and "seal" is hostname for the
wireless interface.)

>[root@localhost otis]# /sbin/iwconfig eth1
>eth1 IEEE 802.11b ESSID:"WirelessFoo"
>Nickname:"localhost.localdomain"
>Mode:Managed Frequency:2.412GHz Access Point:
>00:09:5B:29:41:3F


The device whose MAC address is 00:09:5B:29:41:3F has to be able
to correctly forward and route traffic. It appears from what
you gave above that it might not be doing that.

>If you have a working eth0/eth1 combination, could you please post your
>routing table, so I can at least see if the problem is indeed in
>routes, or elsewhere.


Here is an example that would work. It sends all 192.168.0.x
traffic to the wired LAN, and all 192.168.1.x traffic to the
wireless network. I've made the default a little special,
because it has a 192.168.0.x address for the gateway, but routes
it to eth1, which means that the gateway needs a host route.

Destination Gateway Genmask Flags ... Iface
1 192.168.0.1 * 255.255.255.255 UH ... eth1
2 192.168.0.0 * 255.255.255.0 U ... eth0
3 192.168.1.0 * 255.255.255.0 U ... eth1
4 169.254.0.0 * 255.255.0.0 U ... eth0
5 default 192.168.0.1 0.0.0.0 UG ... eth1

When the ifconfig command for each interface is given, it will insert
a default route based on the address. Those are lines 2 and 3. Line
1 is created with this command:

route add -host 192.168.0.1 dev eth1

You can also generate the exact same entry with this slightly odd
command,

route add -net 192.168.0.1 netmask 255.255.255.255 dev eth1

Line 4 is basically the same as you have been doing apparently,

route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0

The default, line 5, is created with this command,

route add default gw 192.168.0.1 dev eth1

With that you should be able to ping any 192.168.0.x address on
your LAN and any 192.168.1.x address on your wireless net. In
particular, you should be able to ping the access point if it
has a 192.168.1.x address. If it doesn't have a 192.168.1.x
address, add a host route as done above for the gateway. (And
you then might need to specify it as a gateway for all of your
wireless traffic, one address at a time if they are matched by
either of the other two network routes. That is exactly why you
really do want to put the two networks on different subnet
addresses.)

--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) (E-Mail Removed)
 
Reply With Quote
 
Bill Unruh
Guest
Posts: n/a

 
      01-16-2005, 03:45 PM
"OtisUsenet" <(E-Mail Removed)> writes:

>Hello,


>Problem:
>I have eth0 and eth1 (WiFi) and can't get packets over eth1 into 'the
>wild'.
>I suspect the problem is with the routes, but I can't figure out how
>to set them.


Yes.


>Machine, OS, kernel:
>ThinkPad T42, Fedora Core 3, kernel 2.6.9-1.667.


>Routing table right after bringing up the network (both interfaces up):


>Destination Gateway Genmask Flags Metric Ref Use
>Iface
>192.168.0.0 * 255.255.255.0 U 0 0 0
>eth0


Send all packets to any address 192.168.0.x out on eth0

>192.168.0.0 * 255.255.255.0 U 0 0 0
>eth1


Send all packets with address 192.168.0.x on eth1
This is inconsistant with the previous one. Depending on exactly how the
software is written probably only the latest one will work.

but this would never work anyway, since 192.168 addresses are non-routable.
As soon as the first packet got out on the eth1 interface to the first
gateway, it would be thrown away. That is why you are allowed to give your
own addresses of that form, since nothing on the net ever sees them anyway.

To connect to that interface you will HAVE to use eth0


>169.254.0.0 * 255.255.0.0 U 0 0 0
>eth1


Send all packets of the form 169.254.x.y out on eth1

>default 192.168.0.1 0.0.0.0 UG 0 0 0
>eth0


Send all other packets out on eth0

>Pinging my router/gateway:
># ping 192.168.0.1 -I eth1
>PING 192.168.0.1 (192.168.0.1) from 192.168.0.3 eth1: 56(84) bytes of
>data.
>>From 192.168.0.3 icmp_seq=1 Destination Host Unreachable


>Adding a default route for eth1 doesn't help - still can't ping my
>router:
># route add default gw 192.168.0.1 eth1


>Trying to delete all default routes and add default routes for both
>eth0 and eth1, but using 'metric 1' and 'metric 2':


NONONONO There can be only ONE default route. Only one.

># route del default
># route add default gw 192.168.0.1 metric 1 eth0
># route add default gw 192.168.0.1 metric 2 eth1


It cannot get to gateway 192,168.0.1 on eth1. The routing table says "send
all packets for 192.168.0.x to eth0. when it says all it means all. There
is only one route for packets.
>Uh, and this is where I run out of ideas...............



>Does anyone see anything wrong in the above routing table?

Lots.
>The suspicious thing is that this works for eth0:


># route
>Destination Gateway Genmask Flags Metric Ref Use
>Iface
>192.168.0.0 * 255.255.255.0 U 0 0 0
>eth0
>169.254.0.0 * 255.255.0.0 U 0 0 0
>eth0
>default 192.168.0.1 0.0.0.0 UG 0 0 0
>eth0


>While the same thing, but for eth1, does _not_ work for eth1:


># route
>Destination Gateway Genmask Flags Metric Ref Use
>Iface
>192.168.0.0 * 255.255.255.0 U 0 0 0
>eth1
>169.254.0.0 * 255.255.0.0 U 0 0 0
>eth1
>default 192.168.0.1 0.0.0.0 UG 0 0 0
>eth1


Of course it will not work. all 192,168 packets are thrown away by the
first router/geteway they encounter on the 169.254... leg.



>Perhaps the problem is not in my routing table?


It sure is.

You do not tell us what you are trying to do.
Does 192.168.0.1 actually have a conection to the net and is it running as
a masquarading router? If not you will HAVE to use eth1 as your default
route, and find out what the gateway is on that leg.



>Here is what ifconfig and iwconfig show:


>[root@localhost otis]# ifconfig eth1
>eth1 Link encap:Ethernet HWaddr 00:0C:F1:59:B4:3D
>inet addr:192.168.0.3 Bcast:192.168.0.255


This is weird. Why do you have a non-routable address on that wireless leg?
It is not wrong per se, but may indicate something wrong.


>Mask:255.255.255.0
>inet6 addr: fe80::20c:f1ff:fe59:b43d/64 Scope:Link
>UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
>RX packets:0 errors:675 dropped:203 overruns:0 frame:0
>TX packets:986 errors:0 dropped:0 overruns:0 carrier:0
>collisions:0 txqueuelen:1000
>RX bytes:0 (0.0 b) TX bytes:39240 (38.3 KiB)
>Interrupt:11 Base address:0x6000 Memory:c0214000-c0214fff


>[root@localhost otis]# /sbin/iwconfig eth1
>eth1 IEEE 802.11b ESSID:"WirelessFoo"
>Nickname:"localhost.localdomain"
>Mode:Managed Frequency:2.412GHz Access Point:
>00:09:5B:29:41:3F
>Bit Rate=11Mb/s Tx-Powerff
>Retryn RTS thrff Fragment thrff
>Encryption key:1234-4567-4243-4331-3142-0000-00 Security
>modepen
>Power Managementff
>Link Quality=99/100 Signal level=-35 dBm
>Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
>Tx excessive retries:0 Invalid misc:472 Missed beacon:2



>Any help would be very much appreciated.
>I have wireless speakers in my home, but can't get a simple WiFi NIC to
>work.... that's backwards.


>Thank you.


>P.S.
>If you have a working eth0/eth1 combination, could you please post your
>routing table, so I can at least see if the problem is indeed in
>routes, or elsewhere.


 
Reply With Quote
 
Floyd L. Davidson
Guest
Posts: n/a

 
      01-16-2005, 06:43 PM
(E-Mail Removed) (Bill Unruh) wrote:
>
>>Routing table right after bringing up the network (both interfaces up):

>
>>Destination Gateway Genmask Flags Metric Ref Use
>>Iface
>>192.168.0.0 * 255.255.255.0 U 0 0 0
>>eth0

>
>Send all packets to any address 192.168.0.x out on eth0
>
>>192.168.0.0 * 255.255.255.0 U 0 0 0
>>eth1

>
>Send all packets with address 192.168.0.x on eth1
>This is inconsistant with the previous one. Depending on exactly how the
>software is written probably only the latest one will work.


The first entry in the route table will be valid. That will almost
certainly be the one generated by the most recent route command.

>but this would never work anyway, since 192.168 addresses are non-routable.
>As soon as the first packet got out on the eth1 interface to the first
>gateway, it would be thrown away. That is why you are allowed to give your
>own addresses of that form, since nothing on the net ever sees them anyway.


That's not quite true. 192.168.x.x addresses will not be routed
on the Internet, but might well be routed by a wireless access
point.

I'm using a Linksys WRT54G "Wireless-G Broadband Router" (their
description), and assume it is probably representive of how all
wireless "routers" work simply because it makes sense.

There are 5 Ethernet ports on the device, one of which is
labeled as "Internet" and referred to in the documentation as
the "WAN" port. The others are simply labeled from 1 to 4 and
are referred to as "Ethernet" or "LAN" in the docs.

On the LAN ports it is indeed possible to route traffic to and
from the wireless connections (just as the OP is doing).
Indeed, it can be done with subnet masking too, though I don't
actually know if ports can be masked individually or not (I
would assume each port is a separate ethx device, and can indeed
be masked, simply because the router is Linux based.)

I don't use the WAN port at all, but assume that 192.168.x.x
addresses cannot be routed to it. That of course allows the
unit to be used as a LAN gateway to the Internet (it also has
firewall capability), where "LAN" is defined as both wired and
wireless, even though they are on different subnets.

--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) (E-Mail Removed)
 
Reply With Quote
 
Jim Berwick
Guest
Posts: n/a

 
      01-16-2005, 07:22 PM
(E-Mail Removed) (Floyd L. Davidson) wrote in
news:(E-Mail Removed):

> That's not quite true. 192.168.x.x addresses will not be routed
> on the Internet, but might well be routed by a wireless access
> point.
>


Right. My home network is:
Eth0 (LAN): 192.168.a.x
Eth1 (cable): 68.x.x.x
Eth2 (WiFi): 192.168.b.x

I can route just fine between wired, wireless, and I have no problem
DNATing traffic from Eth1 to either Eth0 or Eth2.
 
Reply With Quote
 
Chris Saunderson
Guest
Posts: n/a

 
      01-16-2005, 07:52 PM
Jim Berwick <(E-Mail Removed)> writes:

> (E-Mail Removed) (Floyd L. Davidson) wrote in
> news:(E-Mail Removed):
>
> > That's not quite true. 192.168.x.x addresses will not be routed
> > on the Internet, but might well be routed by a wireless access
> > point.
> >

>
> Right. My home network is:
> Eth0 (LAN): 192.168.a.x
> Eth1 (cable): 68.x.x.x
> Eth2 (WiFi): 192.168.b.x
>
> I can route just fine between wired, wireless, and I have no problem
> DNATing traffic from Eth1 to either Eth0 or Eth2.


RFC-1918 is what's being referred to. 10.x.x.x/8, 172.16.x.x/16 and
192.168.x.x/24 are all supposed to not be routed on the Internet.
The major NSP I worked for used RFC-1918 for our out of band management
nets as well as internal networking, the other NOC engineers I've talked
to do the same.

Chris
--
Chris "Saundo" Saunderson (E-Mail Removed)
Unix/CCNA/CCDA Guy Powered by Linux and the Orb.
 
Reply With Quote
 
Floyd L. Davidson
Guest
Posts: n/a

 
      01-16-2005, 10:46 PM
Chris Saunderson <(E-Mail Removed)> wrote:
>Jim Berwick <(E-Mail Removed)> writes:
>> (E-Mail Removed) (Floyd L. Davidson) wrote:
>>
>> > That's not quite true. 192.168.x.x addresses will not be routed
>> > on the Internet, but might well be routed by a wireless access
>> > point.
>> >

>>
>> Right. My home network is:
>> Eth0 (LAN): 192.168.a.x
>> Eth1 (cable): 68.x.x.x
>> Eth2 (WiFi): 192.168.b.x
>>
>> I can route just fine between wired, wireless, and I have no problem
>> DNATing traffic from Eth1 to either Eth0 or Eth2.

>
>RFC-1918 is what's being referred to. 10.x.x.x/8, 172.16.x.x/16 and
>192.168.x.x/24 are all supposed to not be routed on the Internet.
>The major NSP I worked for used RFC-1918 for our out of band management
>nets as well as internal networking, the other NOC engineers I've talked
>to do the same.


I'm not positive that I'm correctly reading what you are saying.

The point is that RFC-1918 refers to *Internet* routing, not
*intranet* routing. Whether the restricted addresses should, or
not, be routed on an intranet depends; and clearly in the case
of a wireless router they necessarily *must* be routed if the
wireless network is to work seemlessly with the wired network
and still be subnetted.

On most wired networks there would be no real reason to route
those address ranges, and usually RFC-1918 would indeed be
followed.

--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) (E-Mail Removed)
 
Reply With Quote
 
OtisUsenet
Guest
Posts: n/a

 
      01-17-2005, 01:40 AM
Hello,

Floyd L. Davidson wrote:
> "OtisUsenet" <(E-Mail Removed)> wrote:
> >Hello,
> >
> >Problem:
> >I have eth0 and eth1 (WiFi) and can't get packets over eth1 into

'the
> >wild'.
> >I suspect the problem is with the routes, but I can't figure out how
> >to set them.

>
> You haven't said what you want it to do...
>
> Given this is a laptop, you'll want to be able to use either a
> 10baseT wired link or the wireless link. There are only big
> problems if you want to use both at once, because then you have
> to decide which traffic goes to which interface.


Sorry for not saying that. You guessed correctly - this is a laptop
and I want it to use eth0 (10baseT Iface) if I'm plugged into the
network, and if I'm not then I'd like the machine to try going over
eth1 (WiFi).
I don't need to use both at once - one or the other is fine.

> Also realize that you'll necessarily have to assign a different
> host name to each interface if both are to be used at once.
>
> >Machine, OS, kernel:
> >ThinkPad T42, Fedora Core 3, kernel 2.6.9-1.667.
> >
> >Routing table right after bringing up the network (both interfaces

up):
> >
> >Destination Gateway Genmask Flags Metric Ref

Use
> >Iface
> >192.168.0.0 * 255.255.255.0 U 0 0

0
> >eth0

>
> This entry sends all 192.168.0.x traffic to eth0. (Where x is
> any valid address.) The way you determine that is by masking
> (OR'ing) the destination address with the Genmask listed above,
> and if the result matches the "Destination Iface" address on
> that line, that is where the traffic will go. Basically a mask
> of 255 means it must match exactly, and 0 means anything
> matches (and we can ignore other possible masks!)
>
> >192.168.0.0 * 255.255.255.0 U 0 0

0
> >eth1

>
> This entry would do the same as the above, but send it to eth1.
> Except it has already been routed to eth0. Hence this entry has
> no effect.


Yes, that makes sense.

> >169.254.0.0 * 255.255.0.0 U 0 0

0
> >eth1

>
> This will send all traffic for any 169.254.x.x address to eth1.


Yes. (not sure why this 169.254 IP is even in the routing table - it
gets automatically added when I ifup eth0)

> >default 192.168.0.1 0.0.0.0 UG 0 0

0
> >eth0

>
> This sends all traffic not otherwise routed to the 192.158.0.1
> gateway via eth0.


Yes, so that should be anything going out to the Internet, for
instance.

> >The suspicious thing is that this works for eth0:

>
> You can see (at least one reason) why it isn't working. But
> what you have here indicates another problem:
>
> ># route
> >Destination Gateway Genmask Flags Metric Ref

Use
> >Iface
> >192.168.0.0 * 255.255.255.0 U 0 0

0
> >eth0

>
> All 192.168.0.x traffic goes to eth0.
>
> >169.254.0.0 * 255.255.0.0 U 0 0

0
> >eth0

>
> All 169.254.x.x traffic goes to eth0.
>
> >default 192.168.0.1 0.0.0.0 UG 0 0

0
> >eth0

>
> Everything else is sent to the gateway at 192.168.0.1, via eth0.
> It certainly *should* work!
>
> >While the same thing, but for eth1, does _not_ work for eth1:
> >
> ># route
> >Destination Gateway Genmask Flags Metric Ref

Use
> >Iface
> >192.168.0.0 * 255.255.255.0 U 0 0

0
> >eth1
> >169.254.0.0 * 255.255.0.0 U 0 0

0
> >eth1
> >default 192.168.0.1 0.0.0.0 UG 0 0

0
> >eth1
> >
> >Perhaps the problem is not in my routing table?

>
> That should work just fine, as far as this particular host is
> concerned. But the question is, if eth1 is a wireless device...
> what does it connect to? *That* device has to be able to route
> all of these addresses to your wired LAN, and it appears that it
> does not.


Well, I think that this WiFi device (eth1) should route all
non-192.168.0.0 packets to my AP/router (192.168.0.1). That's the only
way I can get out on the WAN, no?

> >Here is what ifconfig and iwconfig show:
> >
> >[root@localhost otis]# ifconfig eth1
> >eth1 Link encap:Ethernet HWaddr 00:0C:F1:59:B4:3D
> >inet addr:192.168.0.3 Bcast:192.168.0.255

>
> For a number of reasons, I'd suggest that you separate your
> wired and wireless networks onto different subnets. It makes
> routing a lot easier. For example, use 192.168.0.x addresses
> for the wired network, and 192.168.1.x addresses for the
> wireless network. (I so something like that, and then use names
> that are easy, for me at least, to match up. For example, my
> laptop's 10baseT interface is named "natchik", which is an
> Inupiat Eskimo word for "seal", and "seal" is hostname for the
> wireless interface.)


I just tried this.
I assigned the WiFi IFace a static IP: 192.168.1.3, while I left the
10baseT IFace at 192.168.0.2.
Router/AP's IP is set in the router and it is: 192.168.0.1.
My Router (Netgear MR814) Admin app does have a section called 'Static
Routes', which lets me enter this:

Route Name [ ]
Private [ ]
Active [ ]
Destination IP Address xxx.xxx.xxx.xxx
IP Subnet Mask xxx.xxx.xxx.xxx
Gateway IP Address xxx.xxx.xxx.xxx
Metric [ ]


I'm not sure what I should enter here. Maybe this is where I could
hook up eth0 and eth1, but I actually don't see why I even need that.
Don't I want eth0 going to the Router and out, as well as eth1 going to
the Router and out. I don't really need my eth0 and eth1 to talk to
each other directly.

The Router also lets me assign IPs to Mac addresses, so that each
device always gets the same IP. So I tried using that to assign
192.168.1.3 to the Mac address of my WiFi card. That didn't work -
apparently the IP has to be in the same subnet as that of the Router,
which is 192.168.0.0.

So I'm not sure how to put eth1/WiFi on a separate subnet...

I _did_ set eth1's IP as 192.168.1.3 in
/etc/sysconfig/network-scripts/ifcfg-eth1 and now I do have that in the
routing table:

# route
Destination Gateway Genmask Flags Metric Ref Use
Iface
192.168.1.0 * 255.255.255.0 U 0 0 0
eth1
192.168.0.0 * 255.255.255.0 U 0 0 0
eth0
169.254.0.0 * 255.255.0.0 U 0 0 0
eth1
default 192.168.0.1 0.0.0.0 UG 0 0 0
eth0


That still doesn't do it, though. With the above I can still only ping
the eth1/WiFi interface if I say ping -I eth1 192.168.1.3. I can't
ping any other IPs using -I eth1.

> >[root@localhost otis]# /sbin/iwconfig eth1
> >eth1 IEEE 802.11b ESSID:"WirelessFoo"
> >Nickname:"localhost.localdomain"
> >Mode:Managed Frequency:2.412GHz Access Point:
> >00:09:5B:29:41:3F

>
> The device whose MAC address is 00:09:5B:29:41:3F has to be able
> to correctly forward and route traffic. It appears from what
> you gave above that it might not be doing that.


That could be it, because I _do_ see my WiFi MAC address in a list of
'attached devices' on the Router. That MAC address above belongs to my
Access Point/Router.

> >If you have a working eth0/eth1 combination, could you please post

your
> >routing table, so I can at least see if the problem is indeed in
> >routes, or elsewhere.

>
> Here is an example that would work. It sends all 192.168.0.x
> traffic to the wired LAN, and all 192.168.1.x traffic to the
> wireless network. I've made the default a little special,
> because it has a 192.168.0.x address for the gateway, but routes
> it to eth1, which means that the gateway needs a host route.
>
> Destination Gateway Genmask Flags ... Iface
> 1 192.168.0.1 * 255.255.255.255 UH ... eth1
> 2 192.168.0.0 * 255.255.255.0 U ... eth0
> 3 192.168.1.0 * 255.255.255.0 U ... eth1
> 4 169.254.0.0 * 255.255.0.0 U ... eth0
> 5 default 192.168.0.1 0.0.0.0 UG ... eth1
>
> When the ifconfig command for each interface is given, it will insert
> a default route based on the address. Those are lines 2 and 3. Line
> 1 is created with this command:
>
> route add -host 192.168.0.1 dev eth1


Of the 5 routes in your routing table, that is the one whose purpose I
don't get. Your 10baseT is on .0.0 subnet, your WiFi is on .1.0
subnet. Anything for .0.x you send to eth0, _except_ when x=1 (so
..0.1), in which case you send packets to WiFi. I'm not sure I
understand why you do that.

Also, the IP in the Gateway column of line 5 (192.168.0.1) belongs to
what IFace? Is that your Router/Gateway? That is what I always
thought goes there.
What is your AP/Router's IP? Which line in the routing table says
'send packets to the AP/Router'?

Ooooh, is that not even needed?

Is this (iwconfig output) all that is needed to tell the kernel to
route packets sent to 'eth1' to the AP, using that AP MAC address:

eth1 IEEE 802.11b ESSID:"Wireless"
Nickname:"localhost.localdomain"
Mode:Managed Frequency:2.412GHz Access Point:
00:09:5B:29:41:3F

Is that it?


> You can also generate the exact same entry with this slightly odd
> command,
>
> route add -net 192.168.0.1 netmask 255.255.255.255 dev eth1
>
> Line 4 is basically the same as you have been doing apparently,
>
> route add -net 169.254.0.0 netmask 255.255.0.0 dev eth0
>
> The default, line 5, is created with this command,
>
> route add default gw 192.168.0.1 dev eth1
>
> With that you should be able to ping any 192.168.0.x address on
> your LAN and any 192.168.1.x address on your wireless net. In


I don't really have any other LAN IPs.
I just have:
..0.1 being the Router/Access Point/DHCP Server/Gateway to WAN
..0.2 10BaseT
..0.3 WiFi (I tried changing it to 1.3)
..0.4 Wife's laptop

I am really mainly trying to get out on the WAN through my Router/AP.

> particular, you should be able to ping the access point if it
> has a 192.168.1.x address. If it doesn't have a 192.168.1.x
> address, add a host route as done above for the gateway. (And
> you then might need to specify it as a gateway for all of your
> wireless traffic, one address at a time if they are matched by
> either of the other two network routes. That is exactly why you
> really do want to put the two networks on different subnet
> addresses.)


But line 5, the default gateway one, goes to eth1. What happens if you
take your laptop to a place without WiFi AP? Don't you have to modify
the routing table then?

I'm still not sure what to do with my WiFi IFace here.
My AP/Router has IP of 192.168.0.1.
My eth0 (10BaseT) has IP of 192.168.0.2.
My eth1 (WiFi) has IP of 192.168.0.3.

With the above IPs, my eth1 MAC address _does_ show up in the AP's list
of 'attached devices', which is a good sign.

If I manually change my Wifi IFace to 192.168.1.3, while leaving my
10baseT IFace on 192.168.0.2, the WiFi MAC address disappears from the
AP's list of 'attached devices'. That is, I think, because of
difference in subnets (.0.0 vs. .1.0). Hmmmm.... Arrrrggggghhhh.

Any more help would be much appreciated.
Thank you.


> --
> Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
> Ukpeagvik (Barrow, Alaska) (E-Mail Removed)


 
Reply With Quote
 
Floyd L. Davidson
Guest
Posts: n/a

 
      01-17-2005, 01:39 PM
"OtisUsenet" <(E-Mail Removed)> wrote:
>Floyd L. Davidson wrote:
>> "OtisUsenet" <(E-Mail Removed)> wrote:
>> Given this is a laptop, you'll want to be able to use either a
>> 10baseT wired link or the wireless link. There are only big
>> problems if you want to use both at once, because then you have
>> to decide which traffic goes to which interface.

>
>Sorry for not saying that. You guessed correctly - this is a laptop
>and I want it to use eth0 (10baseT Iface) if I'm plugged into the
>network, and if I'm not then I'd like the machine to try going over
>eth1 (WiFi).
>I don't need to use both at once - one or the other is fine.


That makes it easy unless you want the selection to be
automatic. I've never tried that... Hmmmm...

>> >Machine, OS, kernel:
>> >ThinkPad T42, Fedora Core 3, kernel 2.6.9-1.667.


I have no idea how Fedora Core 3 manages networking. Therefore
I can't tell you which files or which admin programs are
available to massage networks. I have a "unix" background, and
use Slackware Linux just because it doesn't try to hide the
nitty gritty behind another layer (or two) of obscurity.

Hence,

>> >169.254.0.0 * 255.255.0.0 U 0 0

>0
>> >eth1

>>
>> This will send all traffic for any 169.254.x.x address to eth1.

>
>Yes. (not sure why this 169.254 IP is even in the routing table - it
>gets automatically added when I ifup eth0)


I have no idea where you should look to see what is doing that.
I'd start by looking in /etc/hosts and /etc/networks to see if
there is a name assigned to 169.254 anything. Then I'd use grep
on /etc and all its subdirectories looking for any name assigned
to it, and for the string "169.254". Some place you'll find a
reference to it...

>> concerned. But the question is, if eth1 is a wireless device...
>> what does it connect to? *That* device has to be able to route
>> all of these addresses to your wired LAN, and it appears that it
>> does not.

>
>Well, I think that this WiFi device (eth1) should route all
>non-192.168.0.0 packets to my AP/router (192.168.0.1). That's the only
>way I can get out on the WAN, no?


Actually, it should *all* be routed to the eth1 interface.

That is as opposed to sending it specifically to an address
reached on that interface (which would be a gateway). That
could be done, but isn't necessary. Just having a route which
masks everything to a 192.168.x.x address and routes to eth1
will do fine. Wireless is much like a point-to-point link using
PPP in that respect. There is only 1 node physically connected
to the interface, so there is no need to specify it as a
gateway. Of course that does mean that node must necessarily be
capable of IP forwarding and routing.

Regardless, a command like

route add -net 192.168.0.0 netmask 255.255.0.0 dev eth1

will add the proper route, and will show up looking like,

192.168.0.0 * 255.255.0.0 U 0 0 0 eth1

The ifconfig program, when you bring up the interface, will
automatically add a route that looks like this,

192.168.0.0 * 255.255.255.0 U 0 0 0 eth1

It isn't needed, though it does no harm. If you want you
can remove it with,

route del -net 192.168.0.0 netmask 255.255.255.0 dev eth1

>> For a number of reasons, I'd suggest that you separate your
>> wired and wireless networks onto different subnets. It makes
>> routing a lot easier. For example, use 192.168.0.x addresses


....

>I just tried this.


But you only separated half of it, so how could it work?

>I assigned the WiFi IFace a static IP: 192.168.1.3, while I left the
>10baseT IFace at 192.168.0.2.
>Router/AP's IP is set in the router and it is: 192.168.0.1.


Change that to 192.168.1.1.

>My Router (Netgear MR814) Admin app does have a section called 'Static
>Routes', which lets me enter this:
>
>Route Name [ ]
>Private [ ]
>Active [ ]
>Destination IP Address xxx.xxx.xxx.xxx
>IP Subnet Mask xxx.xxx.xxx.xxx
>Gateway IP Address xxx.xxx.xxx.xxx
>Metric [ ]


More on this, farther down.

>Don't I want eth0 going to the Router and out, as well as eth1 going to
>the Router and out. I don't really need my eth0 and eth1 to talk to
>each other directly.


eth0 and eth1 are interfaces. Only one of them is connected to the
router. 192.168.0.x and 192.168.1.x are subnetted IP address ranges.

If you disconnect your wired LAN from eth0, then you want *everything*
to go to eth1. Of course, if instead you turn off the wireless router,
and still have the LAN connected, then you want everything going to eth0.

And if you have them both connected at once you'll have the
option of deciding (and using this option is not optional, you
*must* decide what goes where) which traffic goes to which
interface. And it should be obvious that you can decide all or
any of it goes to one or the other. The only thing is that you
can't ever send to more than one route.

Lets draw a diagram of an example network, to make it a little
more clear just what function that Route/AP has.

Internet
| (Ethernet)
+---------+ |
| Gateway |----+ \ /
+---------+ | / \
| +---------+ |
+----| wifi AP |---+
| +---------+
+---------+ | \ /
| Host 1 |----+ / \
+---------+ | | +---------+
| +--x<->x--| |
| | Laptop |
+---------------------o o--| |
| +---------+
+---------+ |
| Host 2 |----+ \ /
+---------+ | / \
| | +---------+
v +---------| Host 3 |
+---------+

\__Sub Net 192.168.0.x__/ \____Sub Net 192.168.1.x____/


Everything on the left is part of the wire network, and has an
address of 192.168.0.x, and everything on the right is part of
the wireless network and has an address of 192.168.1.x.

The "wifi AP" sits in the middle, and connects to *both*. Indeed,
it is the *only* connection between them. (Note that for this
example the laptop is *physically disconnected* from the wired
network.

The /etc/hosts file in *every* node needs the address and name
of *every* interface on that network (assuming they are all to
be able to communicate with each other).

The connection between the two networks is the "Wifi AP". It
*necessarily must* 1) do ip forwarding and 2) routing to both
networks. I *must* have a route to each and every node on the
wired network that is expected to communicate with *any* device
on the wireless network.

And each host on the wired network needs to send traffic for the
wireless network to the wifi AP, and therefore each host must
route 192.168.1.x traffic to the ethernet, *and* either that
traffic must be addressed to the wifi AP as a gateway *or* the
wifi AP must know the IP address of every connected wireless
client and have ip forwarding and a route enabled to that
client.

Hence if the laptop is expected to be able to nfs mount file
systems from Host 2, or to allow telnet or ssh/ssl in either
direction, the Wifi AP *must* have a route to Host 2. (This is
very handy too! Laptop keyboards are a pain to use, so I very
commonly fire up the laptop and set it aside while I telnet into
it from my workstation with a nice keyboard and a screen that is
twice as large...)

>The Router also lets me assign IPs to Mac addresses, so that each
>device always gets the same IP. So I tried using that to assign
>192.168.1.3 to the Mac address of my WiFi card. That didn't work -
>apparently the IP has to be in the same subnet as that of the Router,
>which is 192.168.0.0.


I'm not sure what you did there, as far as "assign IPs". On the
laptop, the ifconfig command assigns the IP for that interface.
You can use a "static IP" or use DHCP to get an IP assigned by a
DHCP server (which might be the Wifi AP, for example). There
are advantages to both. If you commonly plug into various
networks that do DHCP, then you'll want to configure your laptop
to deal with that. Otherwise it is easier, on a small network,
to just use static IPs.

I have no idea how Fedora Core sets up DHCP, so I can't help you
with that at all.

Regardless, you will want to move the Wifi AP's IP address to
the wireless subnet anyway. So do assign it an address like
192.168.1.1. Then, if it is used as a DHCP server, you'll get
your 192.168.1.x addresses for wifi interfaces, or just use
static IP's and assign the laptop 192.168.1.3 as you describe
below.

>I _did_ set eth1's IP as 192.168.1.3 in
>/etc/sysconfig/network-scripts/ifcfg-eth1 and now I do have that in the
>routing table:
>
># route
>Destination Gateway Genmask Flags Metric Ref Use
>Iface
>192.168.1.0 * 255.255.255.0 U 0 0 0
>eth1


This routes everything with a wifi subnet address to the wifi interface.
It doesn't allow you access to the LAN via the wifi AP.

>192.168.0.0 * 255.255.255.0 U 0 0 0
>eth0


This routes everything with a LAN subnet address to the LAN... except
you don't have the LAN connected, and instead have the wifi interface
active.

So you need to 1) make sure the eth0 interface is down, 2) delete any
and all routes to eth0, 3) add routes for all of your LAN nodes to be
sent to the eth1 interface. Of course that means that all of these
IP addresses get sent to the Wifi AP, and that means it *must* have
routes to any LAN address that is intended to communicate with the
laptop.

>169.254.0.0 * 255.255.0.0 U 0 0 0
>eth1


Figure out where that comes from, and delete whatever is causing it.

>default 192.168.0.1 0.0.0.0 UG 0 0 0
>eth0


This won't work, because the eth0 interface is supposed to be
disconnected and everything should go to the eth1 interface.
Once there is a route for 192.168.0.1, then you can set up a
default gateway route to that node (via eth1 though).

>That still doesn't do it, though. With the above I can still only ping
>the eth1/WiFi interface if I say ping -I eth1 192.168.1.3. I can't
>ping any other IPs using -I eth1.


Because there are no routes. I suspect the Wifi AP also has no
routes either. So initially all you want to accomplish is being
able to ping the Wifi AP. Then get it to where you can ping
other hosts on the ethernet (which will require proper routes
through the AP).

I'm not specifically familiar with your Wifi Router/AP. The
table of inputs that you gave,

Route Name [ ]
Private [ ]
Active [ ]
Destination IP Address xxx.xxx.xxx.xxx
IP Subnet Mask xxx.xxx.xxx.xxx
Gateway IP Address xxx.xxx.xxx.xxx
Metric [ ]

looks very similar to what the Linksys WRT54G that I have uses,
and I can't say that I fully understand what they are doing! I
had a heck of a time experimenting with it to see what it would
accept and what it wouldn't.

I have no idea what "Private" or "Active" might do. Otherwise I
assume there is some similarity between the others and what
shows up on a route table in Linux. But since, other than
deriving it from the IP address, there is no way to say "host"
or "net", it might do funny things.

Try things like,

A. Enter a route name like "wired_subnet"
B. Ignore both "Private" and "Active"
C. Enter an IP address of "192.168.0.0"
D. Enter a subnet mask of "255.255.0.0"

See what that gets you. Hopefully it would be a route to *all*
192.168.0.0 addresses. You might try both yes and no for Active,
and also for Private.

If that doesn't work, name a route for each of your hosts, enter
the host's IP address and use 255.255.255.255 for the mask, and
make a route for each of them.

And try a default too, using 0.0.0.0 for the IP address and a
0.0.0.0 mask, and enter your gateway's IP address for the
gateway.

>> The device whose MAC address is 00:09:5B:29:41:3F has to be able
>> to correctly forward and route traffic. It appears from what
>> you gave above that it might not be doing that.

>
>That could be it, because I _do_ see my WiFi MAC address in a list of
>'attached devices' on the Router. That MAC address above belongs to my
>Access Point/Router.


Yes. That indicates you have a connection between the AP and
your client in the laptop, which means you have all of the other
pieces, like crypto key's and essid, matching up okay at least
to a point where you can test it. If is shows up as all 00's,
there is no connection.

>> Destination Gateway Genmask Flags ... Iface
>> 1 192.168.0.1 * 255.255.255.255 UH ... eth1
>> 2 192.168.0.0 * 255.255.255.0 U ... eth0
>> 3 192.168.1.0 * 255.255.255.0 U ... eth1
>> 4 169.254.0.0 * 255.255.0.0 U ... eth0
>> 5 default 192.168.0.1 0.0.0.0 UG ... eth1
>>
>> When the ifconfig command for each interface is given, it will insert
>> a default route based on the address. Those are lines 2 and 3. Line
>> 1 is created with this command:
>>
>> route add -host 192.168.0.1 dev eth1

>
>Of the 5 routes in your routing table, that is the one whose purpose I
>don't get. Your 10baseT is on .0.0 subnet, your WiFi is on .1.0
>subnet. Anything for .0.x you send to eth0, _except_ when x=1 (so
>.0.1), in which case you send packets to WiFi. I'm not sure I
>understand why you do that.


That was just to demonstrate that the IP subnet addresses and
the routing are two entirely separate things. That distinction
is what is causing you all the problems!

First, that example is for a system with both eth0 and eth1
interfaces up and functioning. The eth0 interface has an
address in the 192.168.0 subnet, and physically is connected by
ethernet to every device that has such an address. Hence
routing 192.168.0.x traffic to that interface will work.

But lets pull the plug on that interface, and fire up the eth1
interface to the wifi AP. The eth1 interface has a 192.168.1.x
subnet address and is physically connected only to the wifi AP.

But, since we've pulled the plug on the wired LAN (and walked
across the street or something), we have no route available to
the 192.168.0.x subnet *other than through eth1 and the wifi AP*,
all of which are on the 192.168.1.x subnet.

So to fix that, we make sure there are no routes at all to the
disabled eth0 interface, and add a route to send *everything* to
the eth1 interface. In order for that to work of course...
something on the 192.168.1.x subnet must necessarily forward
traffic with 192.168.0.x addresses to the wired network. Since
wireless is basically point to point, obviously whatever your AP
is, if this is to work, has to forward those packets.

(In your case a router is used as an AP, and obviously that
should work if it has the right routing set up; but consider an
Ad-Hoc network where two client wireless cards can talk to each
other. In that case, the client might be your Host 3 node, and
no it is not necessarily going to forward packets anywhere! Of
course one could set up a Linux box with a wireless client, one
port going to the Internet and 4 ports for local ethernet
host... and that is exactly what a Linksys WRT54G is, too!)

Anyway, so now that we've routed all traffic to the eth1
interface, lets go back over and plug in the cable to eth0
again. Hmmm... we have *two* possible routes to the
192.168.0.x subnet. But, when the ifconfig command is used it
will supply a default 255.255.255.0 masked route, which means if
you ping any 192.168.1.x address it will still go to the wifi
router, and any 192.168.0.x address will now be routed to the
eth0 wired interface. But... with two functional links
available, it doesn't _have_ to be that way!

To demonstrate that, I put in that one route, to the gateway,
which goes to the wifi router via eth1 instead of going via
eth0. (You could, for example, then use any of the firewall
capabilities of the router to filter packets sent to the Internet
while not filter those sent to local wired hosts.)

The point is, if you have two routes you can mask off subnets,
but you can also route individual hosts to either interface.

But in either case there must be a *physical* *connection* to
the destination and there must be a *route* through every node
in that physical connection.

If you route traffic to eth0, and unplug it... no connection.
If you route traffic to eth1 and the AP drops the traffic because
it has no route for it... no connection.

And the fact that eth1 has a 192.168.1.x address itself in no
way means it has to carry only 192.168.1.x packets.

>Also, the IP in the Gateway column of line 5 (192.168.0.1) belongs to
>what IFace? Is that your Router/Gateway? That is what I always
>thought goes there.


Yes, that is the address of the Internet gateway.

>What is your AP/Router's IP? Which line in the routing table says
>'send packets to the AP/Router'?
>
>Ooooh, is that not even needed?


!!!! Exactly! Because *everything* sent to eth1 necessarily goes
to the AP. The trick is making sure the AP itself has a route for
everything it is supposed to see.

>Is this (iwconfig output) all that is needed to tell the kernel to
>route packets sent to 'eth1' to the AP, using that AP MAC address:
>
>eth1 IEEE 802.11b ESSID:"Wireless"
>Nickname:"localhost.localdomain"
>Mode:Managed Frequency:2.412GHz Access Point:
>00:09:5B:29:41:3F
>
>Is that it?


All that tells you is that the wireless client is talking to the
wireless AP whose MAC is 00:09:5B:29:41:3F, and can be accessed
via the eth1 interface. It has *nothing* to do with which packets
will be sent to eth1.

*Only* the route tables decide that.

Note that while your particular devices are using eth0 and eth1
as the interface names, on my laptop eth0 is the ethernet
interface, and the internal wireless client gets wlan0. When I
use a pcmcia wireless client in addition to the onboard client,
the card gets the wlan1 interface. (The wlan0 intefaces are all
based on Broadcom wireless chips.) On another machine I have a
wireless client based on an rt2500 chip, and that driver uses
ra0 as the name for the interface. The interface name does not
have any relationship to the IP address until you use the
ifconfig program to assign an address, and it can be any valid
IP address you choose to use.

>But line 5, the default gateway one, goes to eth1. What happens if you
>take your laptop to a place without WiFi AP? Don't you have to modify
>the routing table then?


Of course. You can't route traffic to a network that is not
connected! Just as you cannot use routing to your 10baseT eth0
interface if you unplug it and walk across the street, you
certainly cannot route traffic to the wireless net if you turn
off the AP or move the laptop to anyplace that it cannot connect
from.

Hence you *necessarily* must have different routing setups for

1) Having both eth0 and eth1 functional.
2) Having only eth0 functional.
3) Having only eth1 functional.

And, it should also be obvious that if your laptop is connected
via eth0 to your home network (with some specific Internet
gateway, for example, and perhaps with a static address of its
own that is known to other hosts on your network), it has a
configuration for both the interface and the route tables that
will not necessarily work if you unplug it and visit a friend to
plug into his network.

The same is true of the wifi AP, in that if you change AP's,
the entire configuration needs to be redone to match.

>I'm still not sure what to do with my WiFi IFace here.
>My AP/Router has IP of 192.168.0.1.


Change that to 192.168.1.1

>My eth0 (10BaseT) has IP of 192.168.0.2.


Fine.

>My eth1 (WiFi) has IP of 192.168.0.3.


Change that to 192.168.1.3

>With the above IPs, my eth1 MAC address _does_ show up in the AP's list
>of 'attached devices', which is a good sign.


But since it is a 192.168.0.x address, you'll play Hell trying to
mask it off!

>If I manually change my Wifi IFace to 192.168.1.3, while leaving my
>10baseT IFace on 192.168.0.2, the WiFi MAC address disappears from the
>AP's list of 'attached devices'. That is, I think, because of
>difference in subnets (.0.0 vs. .1.0). Hmmmm.... Arrrrggggghhhh.


So change them *both*!

--
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) (E-Mail Removed)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to send packets kernel.lover Linux Networking 0 02-05-2005 12:19 PM
How to send packets out and come back ? frank19991@hotmail.com Linux Networking 10 05-07-2004 03:46 PM
Network Issue possibly from ICMP host unreachables Loren Aman Linux Networking 1 02-23-2004 06:58 AM
Can't seem to get packets to route Anonymous Linux Networking 2 08-23-2003 02:14 AM
Send custom TCP packets Ishwar Linux Networking 3 07-15-2003 10:51 PM



1 2 3 4 5 6 7 8 9 10 11