Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have an Internet-enabled machine, HostA, with one NIC. I have another machine, HostB, with one NIC that is not Internet-enabled.

I would like HostB to be able to share HostA's Internet-connection. Is this possible using 'some' combination of iptables, tun/tap devices?

Currently, I can use an ssh-based SOCKS proxy on HostB (ssh -D 9050 UserA@HostA) and route traffic of select 'socksifiable' applications on HostB via this proxy to HostA and beyond. However, obviously, not all applications are socksifiable. So, I would like to have the entire network traffic from/to HostB to go via HostA. Now, I know very well that if HostA had 2 NICs, I could have some iptables rules to convert HostA into a gateway that would route traffic between its NIC-1 and NIC-2 (where NIC-1 would be connected to HostB and NIC-2 to Internet). But installing another NIC in HostA is just not possible.

I'm using Ubuntu 13.

EDIT: Additional details: HostA and HostB are both plugged into a switch. HostA has its default gateway and DNS servers appropriately configured. IPv4 is being used.

share|improve this question
Yes, with an interface alias. But I have no details beyond that. –  Ignacio Vazquez-Abrams May 17 '13 at 12:58
How is HostB Connected to HostA? Is there a switch that connects HostA, HostB, and the Internet Gateway? –  Darth Android May 17 '13 at 14:18
Sorry for not making that clear enough. HostA and HostB are both plugged into a switch. HostA has its default gateways and DNS servers appropriately configured. –  Harry May 17 '13 at 22:20

1 Answer 1

up vote 0 down vote accepted

Seeing no replies on this forum, I posted it to U&L forum.

Hauke Laging answered it there. Please see this link for the full response.

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.