Don't know how many hours/days I have into this 'simple' problem, but I'm stuck...
What I'm attempting to do is connect an eth0/wlan0 bridge to a ppp session (in other words share a ppp connection to the Internet with eth0 and wlan0.) Here are the details:
I am using an Ubuntu 3.8.13 kernel running hostapd on wlan0. Clients on wlan0 are assigned an IP in the 192.168.15.0 subnet using dnsmasq. There is also an eth0 interface with a static IP of 192.168.15.1. eth0 and wlan0 are combined using br0, and I am attempting to nat addresses from the ppp connection to the eth0/wlan0 bridge.
I am using:
iptables -t nat -A POSTROUTING -s 192.168.15.0/24 -o ppp0 -j MASQUERADE
to create nat, however when the ppp session is up I can ping only the local ppp address, not the remote or any address on the Internet. I am pinging strictly via IP address, not even playing with DNS resolution yet.
Here is the pertinent data:
First, network interfaces:
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
I believe the ppp session is up properly:
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 shows as up in ifconfig:
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 P-t-P: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)
Routing table when ppp0 is up:
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
But, as above, no joy. Can ping ppp0 assigned address (10.159.124.84) but nothing else. What am I missing?
Thanks -