无法设置wlan0 / ppp0网桥

不知道我有多less小时/天进入这个“简单”的问题,但我卡住了…

我试图做的是连接一个eth0 / wlan0桥到一个PPP会话(换句话说与eth0和wlan0共享一个PPP连接到互联网。)下面是详细信息:

我正在使用在wlan0上运行hostapd的Ubuntu 3.8.13内核。 wlan0上的客户端使用dnsmasq在192.168.15.0子网中分配一个IP。 还有一个静态IP为192.168.15.1的eth0接口。 eth0和wlan0使用br0进行组合,并且我正在尝试从ppp连接的n地址到eth0 / wlan0网桥。

我在用:

iptables -t nat -A POSTROUTING -s 192.168.15.0/24 -o ppp0 -j MASQUERADE

创buildnat,但是当ppp会话启动的时候,我只能ping通本地的ppp地址,而不是远程的或者Internet上的任何地址。 我严格通过IP地址ping,甚至没有使用DNSparsing。

这里是有关的数据:

一,networking接口:

auto lo br0 iface lo inet loopback #bridge iface br0 inet static bridge_ports wlan0 eth0 address 192.168.15.1 netmask 255.255.255.0 network 192.168.15.0 broacast 192.168.15.255 # primary interface allow-hotplug eth0 iface eth0 inet manual # wireless wlan0 allow-hotplug wlan0 iface wlan0 inet manual #internet connection auto ppp0 iface ppp0 inet wvdial 

我相信ppp会话正常运行:

 Apr 23 21:29:08 beaglebone pppd[3657]: Script chat -v -f /etc/ppp/chat/gsp1720 finished (pid 3658), status = 0x0 Apr 23 21:29:08 beaglebone pppd[3657]: Serial connection established. Apr 23 21:29:08 beaglebone pppd[3657]: using channel 3 Apr 23 21:29:08 beaglebone pppd[3657]: Using interface ppp0 Apr 23 21:29:08 beaglebone pppd[3657]: Connect: ppp0 <--> /dev/ttyO4 Apr 23 21:29:08 beaglebone pppd[3657]: rcvd [LCP ConfReq id=0x57 <asyncmap 0x0> <magic 0x98a10ed8> <pcomp> <accomp>] Apr 23 21:29:08 beaglebone pppd[3657]: sent [LCP ConfReq id=0x1 <asyncmap 0xa0000> <magic 0x888b7ceb> <pcomp> <accomp>] Apr 23 21:29:08 beaglebone pppd[3657]: sent [LCP ConfAck id=0x57 <asyncmap 0x0> <magic 0x98a10ed8> <pcomp> <accomp>] Apr 23 21:29:09 beaglebone pppd[3657]: rcvd [LCP ConfAck id=0x1 <asyncmap 0xa0000> <magic 0x888b7ceb> <pcomp> <accomp>] Apr 23 21:29:09 beaglebone pppd[3657]: sent [LCP EchoReq id=0x0 magic=0x888b7ceb] Apr 23 21:29:09 beaglebone pppd[3657]: sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0>] Apr 23 21:29:09 beaglebone pppd[3657]: rcvd [LCP DiscReq id=0x58 magic=0x98a10ed8] Apr 23 21:29:09 beaglebone pppd[3657]: rcvd [IPCP ConfReq id=0x59 <compress VJ 0f 01> <addr 10.153.1.1>] Apr 23 21:29:09 beaglebone pppd[3657]: sent [IPCP ConfAck id=0x59 <compress VJ 0f 01> <addr 10.153.1.1>] Apr 23 21:29:09 beaglebone pppd[3657]: rcvd [LCP EchoRep id=0x0 magic=0x98a10ed8 88 8b 7c eb] Apr 23 21:29:09 beaglebone pppd[3657]: rcvd [IPCP ConfNak id=0x1 <addr 10.159.124.84>] Apr 23 21:29:09 beaglebone pppd[3657]: sent [IPCP ConfReq id=0x2 <compress VJ 0f 01> <addr 10.159.124.84>] Apr 23 21:29:09 beaglebone pppd[3657]: rcvd [IPCP ConfAck id=0x2 <compress VJ 0f 01> <addr 10.159.124.84>] Apr 23 21:29:09 beaglebone pppd[3657]: local IP address 10.159.124.84 Apr 23 21:29:09 beaglebone pppd[3657]: remote IP address 10.153.1.1 Apr 23 21:29:09 beaglebone pppd[3657]: Script /etc/ppp/ip-up started (pid 3665) Apr 23 21:29:09 beaglebone pppd[3657]: Script /etc/ppp/ip-up finished (pid 3665), status = 0x0 

ppp0在ifconfig中显示为up:

 root@beaglebone:~# ifconfig br0 Link encap:Ethernet HWaddr 00:e0:4c:81:7b:38 inet addr:192.168.15.1 Bcast:192.168.15.255 Mask:255.255.255.0 inet6 addr: fe80::2e0:4cff:fe81:7b38/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:14847 errors:0 dropped:0 overruns:0 frame:0 TX packets:6907 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:1257312 (1.1 MiB) TX bytes:824099 (804.7 KiB) eth0 Link encap:Ethernet HWaddr 1c:ba:8c:d6:32:fa UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 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:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:40 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:65536 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) ppp0 Link encap:Point-to-Point Protocol inet addr:10.159.124.84 PtP:10.153.1.1 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:35 errors:0 dropped:0 overruns:0 frame:0 TX packets:313 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:1690 (1.6 KiB) TX bytes:35628 (34.7 KiB) wlan0 Link encap:Ethernet HWaddr 00:e0:4c:81:7b:38 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:15693 errors:0 dropped:335 overruns:0 frame:0 TX packets:13238 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:2211558 (2.1 MiB) TX bytes:1872234 (1.7 MiB) 

ppp0启动时的路由表:

 Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface default * 0.0.0.0 U 0 0 0 ppp0 10.153.1.1 * 255.255.255.255 UH 0 0 0 ppp0 192.168.15.0 * 255.255.255.0 U 0 0 0 br0 

iptables的:

 root@beaglebone:~# cat /proc/sys/net/ipv4/ip_forward 1 root@beaglebone:~# iptables -t nat -L -nv Chain PREROUTING (policy ACCEPT 66 packets, 17496 bytes) pkts bytes target prot opt in out source destination Chain INPUT (policy ACCEPT 26 packets, 1715 bytes) pkts bytes target prot opt in out source destination Chain OUTPUT (policy ACCEPT 1 packets, 108 bytes) pkts bytes target prot opt in out source destination Chain POSTROUTING (policy ACCEPT 1 packets, 108 bytes) pkts bytes target prot opt in out source destination 0 0 MASQUERADE all -- * ppp0 192.168.15.0/24 0.0.0.0/0 

但是,如上所述,没有喜悦。 可以ping ppp0分配地址(10.159.124.84),但没有别的。 我错过了什么?

谢谢 –