firmware/src/packages/fff/fff-layer3-ipv4snat/files/usr/lib/firewall.d/30-SNAT

8 lines
245 B
Plaintext

if [ "$(uci -q get gateway.@client[0].nat)" = '1' ]; then
peer_ip=$(uci get gateway.meta.peer_ip)
ipaddr=$(uci get gateway.@client[0].ipaddr)
for ip in $ipaddr; do
iptables -t nat -A POSTROUTING -s $ip -j SNAT --to-source $peer_ip
done
fi