Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.