Take the 2-minute tour ×

How do I get both my PCs connected to the modem on the other end of the house. The 2 PCs are next to each other and the Ethernet cable is just enough to connect the PCs together. Only one of the PCs has working wireless connection.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

as root
set up dhcp
as root edit /etc/dhcp3/dhcpd.conf and make your network declaration look kind of like one that is commented out, substituting appropriate variables where necessary.

subnet netmask {  
  option domain-name-servers;  
  option routers;  
  option broadcast-address;  
  default-lease-time 600;  
  max-lease-time 7200;  

you could copy and paste that into the end of the file, but i think it's better to understand it

and the eth0 interface with a static ip of would be a pretty reasonable setup

sudo service dhcp3-server restart

change any pertinent firewall rules - adding the following lines to the end of rc.local should do it to enable nat on next boot

/sbin/iptables -P FORWARD ACCEPT
/sbin/iptables --table nat -A POSTROUTING -o wlan0 -j MASQUERADE

I have a shell script that does this for me on startup

depending on the cards, the cable might need to be a crossover cable

one additional note, for ip_forward to be set at boot time edit /etc/sysctl.conf
and uncomment

a more in depth tutorial is here: http://ubuntuforums.org/showthread.php?t=713874

share|improve this answer
ok sudo apt-get install dhcp3-server, although setting up the DHCP seems quite scary judging by what I found online. No firewall to get in the way. That's on the router. By the way, both PCs are the same google.com/search?q=ASRock%20ION%20330. Care to give away some straightforward shell to get the DHCP running? –  Frank Dec 8 '10 at 19:48
added some simple-ish steps to get it up and running, good options to have are router and nameserver...look for a template that contains both of those. copy paste uncomment and edit with the right values –  hbdgaf Dec 8 '10 at 19:59
added a template –  hbdgaf Dec 8 '10 at 20:04
need more detail or you got it working? –  hbdgaf Dec 10 '10 at 12:09
Not really, I went to bed and bought a WIFI dongle the day after ;) Thank you for your help. –  Frank Jan 31 '11 at 17:31

Your Answer


