Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

My Questions

Given: a tower running Ubuntu with: wan0) an ethernet interface connected to the 'WAN' which is my internet source; eth0) an ethernet interface connected to my (not yet extant) LAN; and wl0) a wireless interface.

1) How do I bridge wan0 and eth0 transparently as if I were using a router in Bridge Mode?

2) How do I bridge wan0 and eth0 such that the tower is acting like a router, providing internet, creating a subnet, routing, etc?

3) How do I create a WPA or WPA2 network on wl0 with hostapd?


I have a tower I'm using as a server. Where I live, I am part of a controlled LAN (referred to as the WAN). The IT of this WAN registers computers, track use, ensure compliance, etc via MAC addresses. There are many end-users in the WAN, most of whom I don't know or trust. I want to create a LAN within this WAN so that I can protect myself and my network devices, with the caveat that the WAN sees each device, at least with respect to traffic. (You can try to convince me that this is not what I want, but I doubt you will sway me.)

The box currently has Ubuntu and Gentoo on it. Gentoo doesn't boot for kernel config reasons, but once I fix that, I plan for Gentoo to be the primary OS. I have two wired interfaces and one wireless. The wireless is an Ralink RT2760. I know this supports master mode via hostapd.


That I've had with implementing 1-3

1) With my experiments, either wan0 or eth0 had internet. What I mean by this is that either the tower had internet access, or the computer connected to eth0 had internet access.

2) Never got the DHCP voodoo working, not to mention routing. Not sure I have any idea what I was doing.

3) I created a network with SSID test, but my laptop wouldn't connect to it (connection timed out). It was broadcasting as an AP.

Final Words

I want to use command line tools, daemons, .conf files, etc, because I have never had any luck at all getting things like Network Manager to work.

# lspci -s 03:02 -vvv

03:02.0 Network controller: Ralink corp. RT2760 Wireless 802.11n 1T/2R Cardbus
    Subsystem: Ralink corp. Device 2760
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 64 (500ns min, 1000ns max), Cache Line Size: 64 bytes
    Interrupt: pin A routed to IRQ 22
    Region 0: Memory at febf0000 (32-bit, non-prefetchable) [size=64K]
    Capabilities: [40] Power Management version 3
        Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
        Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
    Kernel driver in use: rt2800pci
    Kernel modules: rt2800pci
share|improve this question
up vote 0 down vote accepted

My two ethernet interfaces are named wan0 and eth0. My wireless interface is named wl0. You will need to run: apt install bridge-utils


# Loopback
auto lo
iface lo inet loopback

# Auto
auto wan0
auto eth0
auto wl0
auto br0

# Physical Interfaces
iface wan0 inet manual
iface eth0 inet manual
iface wl0 inet manual
    pre-up iw dev wl0 set type __ap

# Bridge
iface br0 inet dhcp
    bridge_ports wan0 eth0 wl0

2) Still not sure

3) Install (if it's not) hostapd






share|improve this answer
Where do all these lines of configuration go? – Simon Sheehan Feb 13 '12 at 21:25
Those are (slightly edited) versions of /etc/network/interfaces and /etc/hostapd/hostapd.conf respectively. Also, ht_capab and hostapd in general are device specific. To tell if you can use hostapd, run apt install iw and then iw list. You should see Supported interface modes:. If * AP appears below that, hostapd can turn your card into an AP. I know ht_capab could have a lot more to it, but I don't know how to figure out what all my card supports. If iwconfig wl0 mode master does not give you an error, then that might be the way to go.I'm using an RT2760. – Ethan Reesor Feb 13 '12 at 21:31
You should hit the EDIT button on your answer and add that in – Simon Sheehan Feb 13 '12 at 21:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .