Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Typical home-networking xDSL setup on a TG782 router/gateway. Hosts on the local private network are allocated IP-addresses in the range of and can get to WAN through the aforementioned combo device at (the gw for LAN). I'm running Debian on one of the machines ( and want to add an IP-addr. to the same interface, but from a different network (i.e. and be able to route packets to the outside network just like I'm doing now with the current setup.

Here are the details of ifconfig:

wlan2 Link encap:Ethernet HWaddr 94:0c:6d:8d:28:0f
inet addr: Bcast: Mask:

Output of route -n:

Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface UG 0 0 0 wlan2 U 2 0 0 wlan2

So, let's say I will do this:

ip addr add dev wlan2

What changes would I need to make locally, on this machine, so that I would get this working:

telnet -b 80


My assumption is that I would probably need to do some form of internal NAT with iptables, in order to have this properly routed or.. ?


share|improve this question
up vote 3 down vote accepted

iptables -t nat -A POSTROUTING -o wlan2 -j SNAT -s --to-source

Seems to do just that:

# telnet -b 80
Connected to
Escape character is '^]'.
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .