Hey there,
I am running frank-w’s prebuilt deb_stretch_4.14.80_SD on my BPI-R2 and wanted to setup LAN -> WAN NAT for lan0-lan3 and also ap0 so I have my LAN and Wifi on the same subnet. Funny thing is that the NAT only works for ap0 but not for lan0-lan3 even though they are on the same bridge br0. Even when I remove the ap0 from the bridge it does not work.
when looking at the trafffic with TCPdump everything seems fine. Pings are answered fine and tcptraffic is exchanged as well, however when I open a page with firefox it never gets past the TLS-Handshake-Stage. When i use the same computer on the Wifi firefox loads the pages as it is supposed to.
Any ideas?
/etc/network/interfaces:
auto eth0
iface eth0 inet manual
pre-up ip link set $IFACE up
post-down ip link set $IFACE down
#2nd gmac (cpu-port) only in 4.14.53+
auto eth1
iface eth1 inet manual
pre-up ip link set $IFACE up
post-down ip link set $IFACE down
#wan-port as dhcp-client
allow-hotplug wan
iface wan inet dhcp
auto lan0
iface lan0 inet manual
auto lan1
iface lan1 inet manual
auto lan2
iface lan2 inet manual
auto lan3
iface lan3 inet manual
auto br0
iface br0 inet static
address 192.168.0.1
netmask 255.255.0.0
bridge_ports lan0 lan1 lan2 lan3
bridge_fd 5
bridge_stp no
source-directory /etc/network/interfaces.d
*ip addr:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 7a:0a:45:32:3b:1a brd ff:ff:ff:ff:ff:ff
inet6 fe80::780a:45ff:fe32:3b1a/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether ba:e8:c7:15:84:38 brd ff:ff:ff:ff:ff:ff
inet6 fe80::b8e8:c7ff:fe15:8438/64 scope link
valid_lft forever preferred_lft forever
4: wan@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether ba:e8:c7:15:84:38 brd ff:ff:ff:ff:ff:ff
inet 10.10.61.54/20 brd 10.10.63.255 scope global wan
valid_lft forever preferred_lft forever
inet6 fe80::b8e8:c7ff:fe15:8438/64 scope link
valid_lft forever preferred_lft forever
5: lan0@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br0 state LOWERLAYERDOWN group default qlen 1000
link/ether 7a:0a:45:32:3b:1a brd ff:ff:ff:ff:ff:ff
6: lan1@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br0 state LOWERLAYERDOWN group default qlen 1000
link/ether 7a:0a:45:32:3b:1a brd ff:ff:ff:ff:ff:ff
7: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br0 state LOWERLAYERDOWN group default qlen 1000
link/ether 7a:0a:45:32:3b:1a brd ff:ff:ff:ff:ff:ff
8: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue master br0 state LOWERLAYERDOWN group default qlen 1000
link/ether 7a:0a:45:32:3b:1a brd ff:ff:ff:ff:ff:ff
9: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 02:08:22:96:b6:fe brd ff:ff:ff:ff:ff:ff
inet 192.168.0.1/16 brd 192.168.255.255 scope global br0
valid_lft forever preferred_lft forever
inet6 fe80::8:22ff:fe96:b6fe/64 scope link
valid_lft forever preferred_lft forever
10: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 00:08:22:96:b6:fe brd ff:ff:ff:ff:ff:ff
11: ap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq master br0 state UP group default qlen 1000
link/ether 02:08:22:96:b6:fe brd ff:ff:ff:ff:ff:ff
inet6 fe80::8:22ff:fe96:b6fe/64 scope link
valid_lft forever preferred_lft forever
iptables -vnL && iptables -t nat -vnL:
Chain INPUT (policy ACCEPT 1028 packets, 105K bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
13525 1911K ACCEPT all -- br0 wan 0.0.0.0/0 0.0.0.0/0
19798 14M ACCEPT all -- wan br0 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 953 packets, 112K bytes)
pkts bytes target prot opt in out source destination
Chain PREROUTING (policy ACCEPT 3212 packets, 139K bytes)
pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 343 packets, 32359 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 272 packets, 19422 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 4 packets, 1336 bytes)
pkts bytes target prot opt in out source destination
2971 107K MASQUERADE all -- * wan 0.0.0.0/0 0.0.0.0/0