IPtables configuration for different addresses? - Raspberry Pi Forums
i have set openvpn server on rpi3 , have configured route traffic lan via iptables.
working when connected ethernet, if connect wifi instead have change iptables commands, big hassle.
there way prepare iptables such forward traffic interface actually in use without me knowing exact address beforehand?
command have used when setting this: 150 ip address eth0 address network, if connect wifi instead address 192.168.23.153.
, if move rpi unit other house connecting network 192.168.45.xxx instead.
soo easier if there way make work without having edit iptables settings time.
working when connected ethernet, if connect wifi instead have change iptables commands, big hassle.
there way prepare iptables such forward traffic interface actually in use without me knowing exact address beforehand?
command have used when setting this:
code: select all
sudo iptables -t nat -a postrouting -s 10.8.0.0/24 -o eth0 -j snat --to-source 192.168.23.150
, if move rpi unit other house connecting network 192.168.45.xxx instead.
soo easier if there way make work without having edit iptables settings time.
greetings.
that's why need masquerade target: http://www.iptables.info/en/iptables-ta ... radetarget
might use:
sudo iptables -t nat -a postrouting -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j masquerade
"! -d" part filtering off packet going 10.8.0.0/24.
made line without test it.
that's why need masquerade target: http://www.iptables.info/en/iptables-ta ... radetarget
might use:
sudo iptables -t nat -a postrouting -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j masquerade
"! -d" part filtering off packet going 10.8.0.0/24.
made line without test it.
raspberrypi
Comments
Post a Comment