Ubuntu - Routing internet through the wireless router and everything else through LAN

bar1

Expert Member
Joined
Sep 15, 2008
Messages
3,663
Hi everyone,
I been struggling with this for a few days now.

I am using ubuntu (XBMC) and i need all Internet traffic to go through the wireless router
and all other traffic to go through the Lan.

192.168.1.5 - Wlan1 interface
192.168.1.16 - Eth0 interface
192.168.1.1 - Wireless router

route -n:

Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan1
0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 wlan1
0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 eth0

Thanks,
Bar1
 

bar1

Expert Member
Joined
Sep 15, 2008
Messages
3,663
not working:
route -n:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 100 0 0 wlan1


ip route show
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.16
default via 192.168.1.1 dev wlan1 metric 100

but if i run:
ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.16 icmp_seq=2 Destination Host Unreachable
From 192.168.1.16 icmp_seq=3 Destination Host Unreachable
 

ponder

Honorary Master
Joined
Jan 22, 2005
Messages
92,823
Having both interfaces in the same network is not on!
 

graviti

Senior Member
Joined
May 8, 2006
Messages
665
Your network makes no sense. I assume that you are wanting to use Ubuntu as a router. Everyone who wants to access the internet is on the eth0 network, and the wlan0 connects to the Internet via the wireless router.

Logically, wlan and eth are two separate networks on your computer. If they are both connected to the same physical network, then wlan is pointless. But judging by your ping result, they are not. Therefore, because they physically separate, they are logically separate as well. So change your subnet. Either make your ethernet network something like 192.168.0.0 or the wireless network that. Depending on which interface has the most clients facing it, I would change the writer network. I'm assuming Wireless network is router plus your machine, then multiple machines on cabled network. Thus I would go as follows.

Wireless router : 192.168.0.1
Wireless Card : 192.168.0.2
Ethernet card : 192.168.1.16

Then redo the routing

Sent from my new robot. Viva the Droid.
 

bar1

Expert Member
Joined
Sep 15, 2008
Messages
3,663
ok thanks.
I thought i should make 2 IP ranges , but ppl on a separate thread said its not necessary .
will try that :)
 
Top