BLUG: Pseudo wireless bridging with linux to enable entertainment on y

Login / Register
Just incase anyone finds this useful, rather a networking mess, but it was to get a job done, and it did :)

The background, I have a mod chipped xbox, I use it at times to watch divx films on the telly. This weekend, I wanted to use the widescreen TV in the living room, but, I haven't got any handy long ethernet cables, so I had to come up with another way to do it. I have wireless, and ethernet in my laptop, so figured I'd work out how to do it using this, following is the basic configuration.

Windows Box (yeah, yeah) with divx movies shared 192.168.0.1
Laptop wireless interface (eth1) 192.168.0.2
Laptop ethernet interface (eth0) 192.168.0.5
xbox 192.168.0.15

So, basically we need the laptop itself to do some bridging and work out what's where so stuff can flow freely between things on its ethernet interface, and ones on the other side of the wireless connection.

So, we'll started this on the windows side, tell it to route 192.168.0.15 via 192.168.0.2

C:\> route add 192.168.0.15 netmask 255.255.255.255 192.168.0.2

that's us done there. Next comes the laptop, where everything else is done, first of all we bring up the interfaces as mentioned above, with the default route going via eth1 (the wireless), and we add a route to the xbox on eth0

route add 192.168.0.15 dev eth0

so that

23:58 [email protected]:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
192.168.0.15    0.0.0.0         255.255.255.255 UH    0      0        0
eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0
eth1
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0
eth0
0.0.0.0         192.168.0.254   0.0.0.0         UG    0      0        0
eth1

next come the fun bits, first, put both interfaces into promiscuous mode

ifconfig eth0 promisc ; ifconfig eth1 promisc
then we enable proxy arp for each of the interfaces
echo "1" > /proc/sys/net/ipv4/conf/eth0/proxy_arp
echo "1" > /proc/sys/net/ipv4/conf/eth1/proxy_arp

and we should now be able to reach the xbox from the windows machine, and back the other way (we don't really have any way to set up such routes on it) and we can begin watching our movies, as long as they're not requiring too much of the 11MBps from the wireless (I found that ones with surround sound were a bit much), and off we go! :)

By bazza
Created: Wed, 18 Jun 2003 11:36:15 +0000