1

I have a router that provides internet access. Connected to this router is a desktop PC that has working eth0 (static IP address) and wlan0. Also connected to the router is a laptop which I use to access the desktop over eth0 via SSH:

Desktop(wlan0,eth0) ---- Router(internet) ---- Laptop(ssh to Dekstop via eth0)
// wlan0 should get internet access through eth0 and act as DHCP AP

How do I have to configure (in /etc/network/interfaces) the bridge on the desktop PC, so that I can keep eth0 static (same IP address for SSH), but have wlan0 act as an internet-providing DHCP access point (an access point that dynamically hands out IP addresses to connected devices)?

I know how to configure hostapd and have bridge-utils installed. But I did not fully understand how a bridge works. Does the bridge "replace" all bridged interfaces (as seen from "the outside")? If I bridge, what does my router "see" (eth0 or the bridge)?

  • Which distribution is used and version-name – MolbOrg May 7 '14 at 21:27
  • What are you trying to achieve? You want your desktop to be the AP for your network, and your router is cable-only? – TNW May 7 '14 at 21:29
  • @TNW Router is cable-only. I want everything as is now (whole CABLE-part of network uses static IP's) plus being able to use currently unused wlan0 on Desktop as a DHCP access point that provides config-less (dhcp) internet access to WLAN clients. Distribution is Debian. – Foo Bar May 8 '14 at 6:52
3

If I understand correctly what you're asking the closer you can get to what you're describing is by doing this:

  • On the desktop create a bridge (br0) that includes wlan0 and eth0
  • Assign the static IP address that you now have on eth0 to br0
  • Setup a dhcp server on br0

The above will place everyone connecting to the AP (Desktop) on the same network as eth0 and the router.

  • Thanks. When a dhcp-able bridge has a static IP address, why is eth0 still static (I can connect SSH via static address), but the wlan0 is not? So, does the bridge "replaces" all interfaces in it? I mean, the physical cable goes to eth0, but if the bridge has the static IP of eth0, why can I access over eth0 from the outside with the static IP of the bridge? – Foo Bar May 8 '14 at 6:23
  • br0 will be the logical representation of a link between eth0 and wlan0. I.e. the setup will be something like this: You bridge (layer 2) eth0 and wlan0. This means that all traffic is shared between the two based on the bridging rules. By adding an IP to br0 you also "connect" the PC to the bridge. I.e. the bridge now has a leg to eth0, wlan0 and the PC's TCP/IP stack (layer 3). On that (br0) you add the IP address that the PC will use. AFAIK any layer-3 information (e.g. IP addresses) on eth0 and wlan0 won't be used once they become parts of a bridge. – V13 Jun 6 '14 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.