0

Setup: I have a samsung LCD TV that is connected via eth0 to a T41 Thinkpad running Ubuntu 10.10 which is wirelessly connected to the home router.

I am trying to get Samsung's remote control app working on my iPad but the app won't allow me to put in an ip address and only discovers the tv if it's on the same subnet as the iPad (lame).

So I need the laptop to route packets from eth0 to the wireless interface (wlan0), and I need about 3 ports on the wlan0 interface to be forwarded to the samsung tv.

Hopefully all this makes sense. I've been messing around with iptables and samsung is now able to access internet via laptop wireless, but mapping from wlan0 back to the samsung tv is eluding me.

Kolzoi
  • 1
  • 1

2 Answers2

1

This Ubuntu wireless bridge howto contains some info. In particular, you need to:

  • install the bridge-utils package with apt-get install bridge-utils
  • modify /etc/network/interfaces (add the br0 interface, set your wireless device to master mode).
  • add the iptables firewall rules to enable masquerading
  • turn on ip forwarding in /etc/sysctl.conf.
Phil Hollenback
  • 14,947
  • 4
  • 35
  • 52
1

The classic way to bridge networks is not on the IP level, but on the ethernet level. You can set up a bridge (brctl) and look into ebtables to firewall it. This will bridge all packets (so you probably need the same ip range on both ends of the bridge). It's like plugging the cable in directly, it will also take care of any discovery magic the samsung has going on.

If you just need 3 IP ports forwarded, you could either use iptables with the DNAT target:

iptables -t nat -A PREROUTING -p tcp (-i eth0) -d xxx.xxx.xxx.xxx --dport zz -j DNAT --to yy.yy.yy.yy:zz

Or simpler (no bridging needed) and maybe sufficient: a tcp proxy:

simpleproxy -d -L zz -R yy.yy.yy.yy:zz
Joris
  • 5,969
  • 1
  • 16
  • 13