<div dir="ltr">I'm putting together minimal functional configuration for a mesh using the SmartGateway function, using olsrd v0.9.0.1 under OpenWRT v46069. All repeater nodes appear to be successfully building a tunnel back to the gateway node, and repeaters with 1 hop are working fine. However, repeater nodes with more than 1 hop are not getting any traffic outside beyond the gateway. They can ping the gateway node's wan interface, but no further (NAT not working).<br clear="all"><div><br></div><div>Might anyone have working SmartGateway setup under recent versions of OpenWRT which they are using to route over >1 hops? I've unsuccessfully tried out <a href="https://wiki.freifunk.net/OLSR/SmartGateway">Freifunk's recommendations for SmartGateway</a>, but they they make no difference and also appear to be outdated. In particular, olsrd bundled with OpenWRT now includes the function olsrd_setup_smartgw_rules() in its init script, to add such firewall rules:<br></div><div><a href="https://github.com/openwrt-routing/packages/blob/master/olsrd/files/olsrd.init">https://github.com/openwrt-routing/packages/blob/master/olsrd/files/olsrd.init</a><br><br></div><div>I'm quoting below the setup I have, which works fine for repeater nodes of 1 hop, but not greater. Note that repeater nodes have declarations for a non-existent "wan" interface.<br><br></div><div>My guess is that the rules being inserted by olsrd_setup_smartgw_rules() aren't adequate for routing across multiple hops.<br></div><div><br><b>Gateway node ...<br></b><br><i>/etc/config/network:<br></i>config interface 'loopback'<br> option ifname 'lo'<br> option proto 'static'<br> option ipaddr '127.0.0.1'<br> option netmask '255.0.0.0'<br><br>config interface 'wan'<br> option ifname 'eth0'<br> option proto 'dhcp'<br><br>config interface 'tunl0' <br> option ifname 'tunl0'<br> option proto 'none'<br><br>config 'interface' 'mesh' <br> option ifname 'wlan0'<br> option 'proto' 'static'<br> option 'ipaddr' '10.12.1.1'<br> option 'netmask' '255.255.255.0'<br><br><i>/etc/config/olsrd:<br></i>config olsrd<br> option IpVersion '4'<br> option FIBMetric 'flat'<br> option AllowNoInt 'yes'<br> option TcRedundancy '2'<br> option NatThreshold '0.75'<br> option LinkQualityAlgorithm 'etx_ffeth'<br> option SmartGateway 'yes'<br> option SmartGatewayThreshold '50'<br> option Pollrate '0.1'<br> option SmartGatewayUplink 'ipv4'<br><br>config 'LoadPlugin'<br> option 'library' 'olsrd_arprefresh.so.0.1'<br><br>config 'LoadPlugin'<br> option 'library' 'olsrd_dyn_gw.so.0.5'<br> option 'HNA' '0.0.0.0 0.0.0.0'<br> option Ping '8.8.8.8'<br> option PingInterval '30'<br> option PingCmd 'ping -c 1 -q %s'<br><br>config 'LoadPlugin'<br> option 'library' 'olsrd_nameservice.so.0.3'<br> option 'sighup_pid_file' '/var/run/dnsmasq.pid'<br> option 'suffix' '.mesh'<br><br>config 'LoadPlugin'<br> option 'library' 'olsrd_txtinfo.so.0.1'<br> option 'port' '2006'<br> option 'Accept' '127.0.0.1'<br><br>config InterfaceDefaults<br> option MidValidityTime '500.0'<br> option TcInterval '2.0'<br> option HnaValidityTime '125.0'<br> option HelloValidityTime '125.0'<br> option TcValidityTime '500.0'<br> option Ip4Broadcast '255.255.255.255'<br> option MidInterval '25.0'<br> option HelloInterval '3.0'<br> option HnaInterval '10.0'<br><br>config 'Interface'<br> list 'interface' 'wan'<br> option 'Mode' 'ether'<br><br>config 'Interface'<br> list 'interface' 'mesh'<br><br><i>/etc/config/firewall:<br></i>config defaults<br> option syn_flood 1<br> option input ACCEPT<br> option output ACCEPT<br> option forward REJECT<br> option disable_ipv6 1<br><br>config 'zone'<br> option 'name' 'mesh'<br> option 'network' 'mesh'<br> option 'input' 'ACCEPT'<br> option 'output' 'ACCEPT'<br> option 'masq' '1'<br> option 'forward' 'REJECT'<br><br>config zone<br> option name wan<br> option network 'wan'<br> option input ACCEPT<br> option output ACCEPT<br> option forward REJECT<br> option masq 1<br> option mtu_fix 1<br><br>config 'forwarding'<br> option 'src' 'mesh'<br> option 'dest' 'wan'<br><br>config 'forwarding' <br> option 'src' 'mesh' <br> option 'dest' 'mesh'<br><br><b>Repeater nodes ...<br></b><br><i>/etc/config/network:<br></i>config interface loopback<br> option ifname lo<br> option proto static<br> option ipaddr 127.0.0.1<br> option netmask 255.0.0.0<br><br>config interface wan<br> option proto dhcp<br> option type bridge<br><br>config interface 'tunl0' <br> option ifname 'tunl0'<br> option proto 'none'<br><br>config 'interface' 'mesh' <br> option ifname 'wlan0'<br> option 'proto' 'static'<br> option 'ipaddr' '10.12.1.X'<br> option 'netmask' '255.255.255.0'<br><br>config interface lan <br> option ifname eth0 <br> option type bridge<br> option proto static<br> option 'dns' '208.67.222.222 208.67.220.220'<br> option ipaddr 192.168.X.1 <br> option netmask 255.255.255.0 <br><br><i>/etc/config/olsrd: same as gateway node</i><br><br>/etc/config/firewall:<br>config defaults<br> option syn_flood 1<br> option input ACCEPT<br> option output ACCEPT<br> option forward REJECT<br> option disable_ipv6 1<br><br>config 'zone'<br> option 'name' 'mesh'<br> option 'network' 'mesh'<br> option 'input' 'ACCEPT'<br> option 'output' 'ACCEPT'<br> option 'masq' '1'<br> option 'forward' 'REJECT'<br><br>config zone<br> option name lan<br> option network 'lan'<br> option input ACCEPT<br> option output ACCEPT<br> option forward REJECT<br> option masq 1<br><br>config zone<br> option name wan<br> option network 'wan'<br> option input ACCEPT<br> option output ACCEPT<br> option forward REJECT<br> option masq 1<br><br>config 'forwarding'<br> option 'src' 'wan'<br> option 'dest' 'mesh'<br><br>config 'forwarding' <br> option 'src' 'mesh' <br> option 'dest' 'mesh'<br><br>config 'forwarding' <br> option 'src' 'lan' <br> option 'dest' 'mesh'<br><br>config 'forwarding' <br> option 'src' 'mesh' <br> option 'dest' 'lan' <br><br>config 'forwarding' <br> option 'src' 'lan' <br> option 'dest' 'lan'<br><br></div><div><br>-- <br><div class="gmail_signature">Ben West<div><a href="http://gowasabi.net" target="_blank">http://gowasabi.net</a><br><a href="mailto:ben@gowasabi.net" target="_blank">ben@gowasabi.net</a><br>314-246-9434<br></div></div>
</div></div>