Use computer as NAT router or proxy to share access by USB 3G dongle

I'm in a strange, fun situation with a dual boot Windows XP/Ubuntu Linux computer that is only connected to the internet via USB 3G dongle, and I need to connect another device that only has a Ethernet port. The other device does not support connecting via the USB 3G dongle

Is there some magical, hacky software that can turn the unused Ethernet ports of my computer so I just plug the other device and get internet access?


For the XP site: look up 'internet sharing'. You just need to enable this.

For the GNU/Linux site I think that you just need to

  1. Fire up the 3G connection
  2. Assign an IP address to the NIC
  3. Assign a different IP address to the NIC on the other computer
  4. Add routing table entries.
  5. Enable forwarding. ( sysctl -w net.ipv4.ip_forward=1 )

  6. If you are using non public IP ranges (e.g. 192.168/16) and you want to connect to the Internet then you also need to enable IP Masquerading. (Thank you for reminding me of that @MaQleod).

On both cases you need a crossover cable or a MDI/MDX aware port on at least one of the computers.