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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 1 down vote accepted

as root
echo 1 > /proc/sys/net/ipv4/ip_forward
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:

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 Care to give away some straightforward shell to get the DHCP running? – F. Malina 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 – RobotHumans Dec 8 '10 at 19:59
added a template – RobotHumans Dec 8 '10 at 20:04
need more detail or you got it working? – RobotHumans 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. – F. Malina Jan 31 '11 at 17:31

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.