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.

I would like an old desktop box to use my laptop as a router to access the internet. Here is my setup:

network diagram

I have one ethernet port in the side of my laptop which I want to use to get internet access to my desktop computer. The laptop is connected to the LAN via a wireless link. Both systems run Linux. The desktop autoconfigures itself using DHCP. The laptop is a Kubuntu system. I do not have any crossover cables, though wireshark on the laptop sees the DHCP requests from the desktop just fine, so I doubt that I need one.

What do I have to do to make this work?

share|improve this question
    
which device do you want to answer the desktop's DHCP? the laptop or the router (192.168.1.1?) that normally answers DHCP requests on your network? –  quack quixote Mar 26 '10 at 23:18
    
Either one, it doesn't really matter. –  marcusw Mar 26 '10 at 23:19
    
+1 for the diagram. –  Dennis Williamson Mar 27 '10 at 1:46

2 Answers 2

up vote 1 down vote accepted

I did some more experimenting today, it turns out the knetworkmanager includes its own dhcp server (who would have thought?). Anyway, the way to set it up is to:

  1. Click on the knetworkmanager icon in the system tray and select Manage Connections.
  2. Go to the "Wired" tab and click New...
  3. Set "Restrict to interface" to eth0.
  4. Under the IP Address tab, set "Configure" to Shared.
  5. Check "Connect Automatically".
  6. Click OK for all the open dialogues.
  7. A restart of knetworkmanager or the computer to be connected via ethernet may be required.

This will get things up and running, though the ethernet computer will be on a different subnet than the devices on the same subnet as the laptop.

share|improve this answer

You need to create a bridge between your laptop wired network and wireless network. That will let the wired network 'see' the WAP's DHCP server. Take a look at the bridge_utils package. I believe you will need to use bridge_ports to set up the bridge between the two devices.

share|improve this answer
    
My wireless network is encrypted and configured using a netmanager, which means (AFAICT) that a bridge will not work. I have done my homework and tried to bridge the interfaces using a "traditional" bridge, but then knetworkmanager can't configure the wlan. I don't know what you mean about bridge_ports, please elaborate. –  marcusw Mar 28 '10 at 1:26
    
Bridges can connect LANs with different layer 2 protocols; for example, consumer WAPs usually have an Ethernet switch included, and devices connected to the Ethernet LAN can communicate with devices on the WLAN. I don't see any reason why having an encrypted WLAN would prevent your laptop from bridging traffic from an Ethernet port -- if the WLAN card permits source address spoofing (traffic from your wired box will of course have the source address of the wired box and not the laptop). bridge_ports is how you tell the bridge device which physical devices will be bridged. –  Fred Mar 29 '10 at 2:44
    
I'm not sure what you mean by a 'traditional' bridge. What is in your /etc/network/interfaces? –  Fred Mar 29 '10 at 2:45
    
When I run "brctl addbr eth2wlan; brctl addif eth2wlan eth0; brctl addif eth2wlan wlan0; ifconfig eth2wan up", I lose my wireless net connection and knetworkmanager cannot reauthenticate with the WAP. What are the commands I should be running? –  marcusw Mar 29 '10 at 18:11
    
Mr. Google seems to think that networkmanager isn't compatible with bridging. Try using 'dhclient eth2wan' instead of 'ifconfig eth2wan up'. I'm sorry I don't have a setup like this at home, or I'd try it before advising. –  Fred Mar 30 '10 at 22:32

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.