Hi! Some general question + Wifi USB Realtek RTL8191S

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby matzi » Wed Oct 23, 2013 5:00 am

The Output is:

root@fvdwsl-base:/ # busybox route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.178.1 0.0.0.0 UG 0 0 0 eth0
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0

I am not familiar with route instruction. Obviously a rule for wlan0 is missing. Shall I add a copy of the two existing lines changing eth0 by wlan0? If so, how were the existing entries created? I never used route command before.
matzi
Donator VIP
Donator VIP
 
Posts: 253
Joined: Wed Jul 06, 2011 8:08 am
Location: Hannover Germany

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby Jocko » Wed Oct 23, 2013 7:12 am

Hi matzi,

Indeed, some routes are missing for wlan0.

You must add two routes :
- default route for WAN connection (need a gateway)
- route for LAN address (gateway is useless). It's amazing that this route is not created when you configures wlan0 :dry because it's the default behaviour with an Ethernet NIC.

So do these commands
Code: Select all
route add -net 192.168.178.0 netmask 255.255.255.0 dev wlan0
route add -net 0.0.0.0 gw 192.168.178.1 dev wlan0

Now, you should keep an active connection when you unplug the network cable of eth0 :-D

For deleting a route, the commands are
with the default route
Code: Select all
route del -net 0.0.0.0 dev wlan0
and for LAN address
Code: Select all
route del -net 192.168.178.0 netmask 255.255.255.0 dev wlan0


Note: no need to use 'busybox' in these commands because a symlink already exists
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby matzi » Wed Oct 23, 2013 8:24 pm

I tried the proposal with the routing table. But no success. Still the same behaviour. I noticed that the routing table looses an Entry after unplugging the cable (see below):

Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.178.1 0.0.0.0 UG 0 0 0 eth0
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0

it looses the line with :
0.0.0.0 gw 192.168.178.1 wlan0

Remark: I'm pretty sure the dongle itself is OK, because it is running in my raspberry pi without a problem in wpa encryption.
matzi
Donator VIP
Donator VIP
 
Posts: 253
Joined: Wed Jul 06, 2011 8:08 am
Location: Hannover Germany

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby fvdw » Thu Oct 24, 2013 6:43 am

maybe Jocko knows a next step

ps what happens if instead of unplugging you bring down the interface
so
Code: Select all
ifconfig eth0 down
fvdw
Site Admin - expert
 
Posts: 13471
Joined: Tue Apr 12, 2011 2:30 pm
Location: Netherlands

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby Jocko » Thu Oct 24, 2013 7:36 am

Yes fvdw,

Bring down eth0 should force the firmware to use wlan0.

Other idea that I must deepen, currently you have the same metric for the two NIC. So maybe increase metric for eth0 will do the same thing than bring down eth0.

You can also check you route table with the command traceroute
Code: Select all
traceroute -i iface 192.168.178.xx
where iface is eth0 or wlan0 and 192.168.178.xx another host of your LAN
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby matzi » Thu Oct 24, 2013 6:28 pm

A small progress step but still confusing:

When I do the sequence "eth0 down" and then unplug the cable, the wireless connection persists. Strange thing it is persists under wireless and also under the wired IP!

Traceroute gives:
root@fvdwsl-base:/ # traceroute -v -i wlan0 192.168.178.20
traceroute to 192.168.178.20 (192.168.178.20), 30 hops max, 38 byte packets
1 192.168.178.20 (192.168.178.20) 46 bytes to (null) 9.239 ms 5.436 ms 11.794 ms




Routing table in this state is:
root@fvdwsl-base:/ # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.178.17 0.0.0.0 UG 0 0 0 wlan0
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0

(I used a different router with IP ending 17)
Last edited by matzi on Thu Oct 24, 2013 6:45 pm, edited 1 time in total.
matzi
Donator VIP
Donator VIP
 
Posts: 253
Joined: Wed Jul 06, 2011 8:08 am
Location: Hannover Germany

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby Jocko » Thu Oct 24, 2013 6:36 pm

Hi matzi,

Currently I am playing with an USB LAN adapter and so some similar issues than you.

With my test, set a metric doesn't change the default behaviour : eth0 is always used. Only bringing down eth0 allows to use the additional NIC.

So you can do it but be careful if wlan0 is not rightly set you will lost all access and you should reboot your NAS.

Note : if you bring up again eth0 only route for your LAN is restored you must manually add the default route (with the gateway) for eth0

---about your last post---
Traceroute gives:
root@fvdwsl-base:/ #
Code: Select all
traceroute -v -i wlan0 192.168.178.20
traceroute to 192.168.178.20 (192.168.178.20), 30 hops max, 38 byte packets
1 192.168.178.20 (192.168.178.20) 46 bytes to (null) 9.239 ms 5.436 ms 11.794 ms

Routing table in this state is:
Code: Select all
root@fvdwsl-base:/ # route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.178.17 0.0.0.0 UG 0 0 0 wlan0
192.168.178.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
this means that your wlan NIC runs well

But about your amazing test
When I do the sequnce "wlan0 down" and then unplug the cable, the wireless connection persists. Strange thing it is persists under wireless and also under the wired IP!

after doing ifconfig wlan0 down, did you check if wlan0 was really bring down ? if it is still listing with
Code: Select all
ifconfig
then the command failed
---edit---
and also its routes must disappear in the route table.

Maybe you must use iwconfig to do it
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby matzi » Thu Oct 24, 2013 6:42 pm

Excuse me in my last post it should read of course "after eth0 down"

eth0 is down, see below complete output of ifconfig:

root@fvdwsl-base:/ # ifconfig
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:65536 Metric:1
RX packets:4666 errors:0 dropped:0 overruns:0 frame:0
TX packets:4666 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:632383 (617.5 KiB) TX bytes:632383 (617.5 KiB)

wlan0 Link encap:Ethernet HWaddr 7C:DD:90:17:C3:09
inet addr:192.168.178.21 Bcast:192.168.178.255 Mask:255.255.255.0
inet6 addr: fe80::7edd:90ff:fe17:c309/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3483 errors:0 dropped:0 overruns:0 frame:0
TX packets:1941 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:588915 (575.1 KiB) TX bytes:282726 (276.0 KiB)
matzi
Donator VIP
Donator VIP
 
Posts: 253
Joined: Wed Jul 06, 2011 8:08 am
Location: Hannover Germany

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby Jocko » Thu Oct 24, 2013 6:44 pm

I edit my previous post...
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Hi! Some general question + Wifi USB Realtek RTL8191S

Postby matzi » Thu Oct 24, 2013 6:56 pm

Yes I fully agree with your last post. Just a short moment before your post I tried to explain mine....
So I just did what you proposed yesterday. When both connections are up, then set eth0 down. That worked so far. Strange is the persisting IP of the wired connection.
matzi
Donator VIP
Donator VIP
 
Posts: 253
Joined: Wed Jul 06, 2011 8:08 am
Location: Hannover Germany

PreviousNext

Return to Development

Who is online

Users browsing this forum: mistert and 10 guests