I have an Ubuntu box with IP forwarding enabled and a very simple iptables configuration to allow all packets from within the LAN to be forwarded:
echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -I FORWARD -s 192.168.4.0/24 -j ACCEPT
This works fine, except the SMB shares on the box no longer work, presumably because the packets that end with the box itself as a destination are also being forwarded.
Is there a simple solution so that any TCP connection requests to the box itself will not be forwarded, only requests to external IP addresses?
-d
) is the modem/router? Something like/sbin/iptables -I FORWARD -s 192.168.4.0/24 -d 192.168.4.1 -j ACCEPT
maybe? serverfault.com/a/140626/486251