Internet connection sharing on Linux (IP Masquerading on a Powerbook) February 2, 2006
Posted by spanky in Linux, apple.trackback
So I left my PCI wireless card with Linux drivers at school, my wireless router is next to the TV and not a great place to setup a Linux box, and I want to install packages onto a Linux box I’m setting up. I recently put Linux on my Powerbook, so what is commonly termed “Internet Connection Sharing” is no longer as easy as it used to be, and is bound to be a pain in the ass.
Or is it?
To clarify, what I wanted to do was share my Powerbook’s wireless connection over its Ethernet port. There are quite a few good tutorials on setting up IP masquerading, but the only one I needed was here. I copied and pasted that script into init.d, made it executable, and ran it on the Powerbook. It checks for and loads modules that I’m sure are running already, changes some network settings, and then sets up the forwarding rules in iptables. Note that I had to change 2 lines in the script, since my external interface was eth1 (wireless) and my internal interface was eth0 (wired Ethernet). I ran that, set the IP address on the host Powerbook to 192.168.2.1, set the IP address on the client system to 192.168.2.2 (both via ifconfig) and then “sudo route add default 192.168.2.1″ to the client system, and done. Pings, DNS, it was all taken care of.
Comments»
No comments yet — be the first.