NanoPi R2S network configuration (armbian)

# add following line in /etc/sysctl.conf
net.ipv4.ip_forward=1

# Forward all traffic with masquerading ip from lan0 to eth0 (internet share)
/sbin/iptables -t nat -A POSTROUTING -j MASQUERADE

# Forward incoming connection from eth0 or tun0 to lan0 (port forwarding)
/sbin/iptables -t nat -A PREROUTING -i tun0 -p tcp –dport 3389 -j DNAT –to-destination 10.10.0.10:3389
/sbin/iptables -t nat -A PREROUTING -i tun0 -p tcp –dport 22 -j DNAT –to-destination 10.10.0.10:22
/sbin/iptables -t nat -A PREROUTING -i eth0 -p tcp –dport 24800 -j DNAT –to-destination 10.10.0.10:24800

# disabling tx offload on the USB ethernet
# https://forum.armbian.com/topic/10127-ethernet-tx-offload-bug/
/usr/sbin/ethtool -K lan0 tx off

Leave a Reply