You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/bin/bash
# /etc/rc.local
# Default policy to drop all incoming packets.
#iptables -P INPUT DROP
#iptables -P FORWARD DROP
# Accept incoming packets from localhost and the LAN interface.
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i enx00e04c534458 -j ACCEPT
# Accept incoming packets from the WAN if the router initiated the connection.
iptables -A INPUT -i enp2s0 -m conntrack \
--ctstate ESTABLISHED,RELATED -j ACCEPT
# Forward LAN packets to the WAN.
iptables -A FORWARD -i enx00e04c534458 -o enp2s0 -j ACCEPT
# Forward WAN packets to the LAN if the LAN initiated the connection.
iptables -A FORWARD -i enp2s0 -o enx00e04c534458 -m conntrack \
--ctstate ESTABLISHED,RELATED -j ACCEPT
# NAT traffic going out the WAN interface.
iptables -t nat -A POSTROUTING -o enp2s0 -j MASQUERADE
# rc.local needs to exit with 0
exit 0
I may be wrong but without running 'crontab -e' with 'sudo crontab -e' as a member of sudoers, the script won't run and none of the rules will be added on reboot. I was scratching my head why my clients couldn't reach the ROTW for updates until I changed the rule. That said, I set it up late at night and was bleary eyed so I might have missed something. As written it implies non-root user will run the script stored at '/root'.
I'm trying to follow your instructions, but am confused by the lines
Note the proper reference address is now:
(https://blog.ibnus.ac.id/cara-konfigurasi-ubuntu-server-sebagai-router-18-04-1-lts/)