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.

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
add comment

1 Answer

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 192.168.254.0 netmask 255.255.255.0 {  
  range 192.168.254.2 192.168.254.128;  
  option domain-name-servers 4.4.4.4;  
  option routers 192.168.254.1;  
  option broadcast-address 192.168.254.255;  
  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 192.168.254.1 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
net.ipv4.ip_forward=1

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
add comment

Your Answer

 
discard

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.