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.

Main Problem

I want to siphon the Internet access from my Ubuntu 12.04 LTS laptop to my old Windows ME desktop for learning purposes. I have 2 Ethernet cables and a switch with no access to configure the wireless modem/router.

Can anybody tell me where I went wrong?


Physical Layout

  • I have no access to configure the wireless router/modem.

  • I have a 5 port switch.

  • I have Ubuntu on a laptop with a wireless Internet connection on wlan0 at 192.168.0.13 (dhcp). The laptop also is hooked up to a switch via Ethernet cable on eth0 at 192.168.4.2 (static).

  • I have Windows ME also hooked up to the switch via Ethernet cable at 192.168.4.1 (static).

I tried to follow the Debian bridging manual (https://wiki.debian.org/BridgeNetworkConnections). But it was hard for me to follow.

Interface Configuration File

/etc/network/interfaces

My failure, step by step:

Step 1 (successful)

user$ brctl addbr br0

Step 2 (error: can't add wlan0 to bridge br0: Operation not supported)

user$ brctl addif br0 eth0 wlan0

Step 3 (successfully added these lines to /etc/network/interfaces)

pre-up iwconfig wlan0 essid $YOUR_ESSID
bridge_hw $MAC_ADDRESS_OF_YOUR_WIRELESS_CARD

Step 4 (successful)

user$ ebtables -t nat -A POSTROUTING -o wlan0 -j snat --to-src *$br0_MAC-ADDR* --snat-arp --snat-target ACCEPT

Step 5 (successful)

user$ ebtables -t nat -A PREROUTING -p IPv4 -i wlan0 --ip-dst 192.168.0.13 -j dnat --to-dst *$wlan0_MAC-ADDR* --dnat-target ACCEPT

Step 6 (successful)

user$ ebtables -t nat -A PREROUTING -p ARP -i wlan0 --arp-ip-dst 192.168.0.13 -j dnat --to-dst *$wlan0_MAC-ADDR* --dnat-target ACCEPT
share|improve this question
    
Network Manager can auto-configure this, as seen here. Probably worth trying that before you attempt to do it manually... –  user55325 Oct 2 '13 at 3:59
    
It looks like you are running into the same problem stated in this answer. –  hololeap Oct 2 '13 at 9:03

1 Answer 1

What you are trying to accomplish cannot be realized with any wireless card. Your card must be able to support AP mode; you may determine whether your card is suitable for the task by issuing the command

iw list

and searching its output for something similar to this:

Supported interface modes:
             * IBSS
             * managed
             * AP
             * AP/VLAN
             * monitor
             * P2P-client
             * P2P-GO
    software interface modes (can always be added):
             * AP/VLAN
             * monitor

They key word is, of course, AP. If, under "supported interface modes", there is the expression AP, then you are good to go.

Even if your card can be put into AP mode, you cannot do this without the help of the hostapd package. In other words, attempts to do so via iw/iwconfig will fail.

Lastly, contrary to what was stated in the above-referenced serverfault post, you definitely can put an ethernet interface and a wireless interface (in AP mode) in a bridge configuration. This cannot be done via the usual bridge-utils utilities, but once agan requires the hostapd package, which is quite capable of bridging the two interfaces.

The advantage of bridging is that your wifi clients will receive their IP addresses from the router, not from your pc. This is advantageous both because it allows you to avoid setting up a DHCP service, and because your wireless clients have access to all LAN resources, and are also equally visible to all other members of the LAN.

The guide you have been following concerns bridging ethernet interfaces. You need instead a guide for the set-up of wireless interface as an AP via the use of hostapd. I found this particular guide quite helpful.

share|improve this answer

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.