Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I setup a bridge using wired NIC and wireless NIC in order to make wireless NIC as a Wi-Fi AP to share wired internet access, after setup successfully, the Wi-Fi AP works as my expectation, but my laptop can not access internet, please give me a hand. Thanks.

My hostapd.conf

$ cat hostapd.conf 
interface=wlan0
bridge=br0
driver=nl80211
ssid=myAP
hw_mode=g
channel=11
dtim_period=1
rts_threshold=2347
fragm_threshold=2346
macaddr_acl=0
auth_algs=3
ieee80211n=0
wpa=3
wpa_passphrase=PassWord
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Setup steps:

$ sudo killall hostapd
hostapd: no process found
$ sudo hostapd -B hostapd.conf
Configuration file: hostapd.conf
Using interface wlan0 with hwaddr 00:26:5e:e8:4f:8e and ssid 'myAP'
$ sudo brctl addbr br0
device br0 already exists; can't create bridge with the same name
$ sudo ifconfig eth0 0.0.0.0 up
$ sudo ifconfig wlan0 0.0.0.0 up
$ sudo brctl addif br0 eth0
$ sudo brctl addif br0 wlan0
device wlan0 is already a member of a bridge; can't enslave it to bridge br0.
$ sudo ifconfig br0 192.168.1.110 netmask 255.255.255.0
$ sudo route add default gw 192.168.1.1

The chrome prompts:

The server at stackoverflow.com can't be found, because the DNS lookup failed. DNS is the network service that translates a website's name to its Internet address. This error is most often caused by having no connection to the Internet or a misconfigured network. It can also be caused by an unresponsive DNS server or a firewall preventing Google Chrome from accessing the network.



$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.





^C
--- 192.168.1.1 ping statistics ---
64 packets transmitted, 0 received, 100% packet loss, time 63456ms


$ brctl show
bridge name bridge id       STP enabled interfaces
br0     8000.00265ee84f8e   no      eth0
                            wlan0


$ ifconfig
br0       Link encap:Ethernet  HWaddr 00:26:5e:e8:4f:8e  
          inet addr:192.168.1.115  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::226:5eff:fee8:4f8e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:25 errors:0 dropped:0 overruns:0 frame:0
          TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:4038 (4.0 KB)  TX bytes:8111 (8.1 KB)

eth0      Link encap:Ethernet  HWaddr c8:d6:5e:f8:6a:22  
          inet6 addr: fe80::cad6:5eff:fef8:6a22/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:384 errors:0 dropped:0 overruns:0 frame:0
          TX packets:297 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:119746 (119.7 KB)  TX bytes:37055 (37.0 KB)
          Interrupt:46 Base address:0x4000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:62 errors:0 dropped:0 overruns:0 frame:0
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:4712 (4.7 KB)  TX bytes:4712 (4.7 KB)

mon.wlan0 Link encap:UNSPEC  HWaddr 00-26-5E-E8-4F-8E-30-30-00-00-00-00-00-00-00-00  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2514 (2.5 KB)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:26:5e:e8:4f:8e  
          inet6 addr: fe80::226:5eff:fee8:4f8e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:117 errors:0 dropped:0 overruns:0 frame:0
          TX packets:187 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:12139 (12.1 KB)  TX bytes:82155 (82.1 KB)

It had looked like a problem with iptables, but no.

share|improve this question
    
Please add the output of ip route, brctl show, and ifconfig to your question. In particular I'm wondering about what interface your default route is trying to use. Can you ping 192.168.1.1? –  John S Gruber Sep 23 '12 at 4:59
    
@JohnSGruber Thanks for your kindly help, I have resolved this issue, before I setup bridge, I added NAT to iptables, maybe it caused this issue. After I reboot OS, this bridge works. –  Victor S Sep 25 '12 at 16:06
    
@JohnSGruber Excuse me, I encounter this issue again, the browser can not open web due to look up DNS failed. I append some info to my question. –  Victor S Sep 26 '12 at 15:09
    
Would you append the output of ip route? I'd like to see how 192.168.1.x and default are routed, including interfaces. –  John S Gruber Sep 26 '12 at 16:48
add comment

closed as too localized by John S Gruber, hexafraction, Mitch, Jorge Castro, RolandiXor Sep 27 '12 at 0:07

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.