iptables headache after upgrade to Pi2
Posted: Mon Feb 23, 2015 12:48 pm
I am still here asking...
Anyway, after the disk expansion issue I have now come to the OpenVPN functionality.
The Pi2B is running a disk image from a Pi1B where the OpenVPN server was already fully set up and working.
After starting up the Pi2B it naturally received a different IP address from DHCP than the original Pi1B had. So a number of config files have had to be modified accordingly.
But iptables is getting on my back!
There seems to be no configuration file at all where the iptables settings are all listed so they can be edited in a sensible way..
There is one particular item that bugs me and it can be shown as follows (command from an OpenVPN tutorial):
Previous to rebooting after the disk expansion the result was that there were three lines, two of which showed the old IP address ending in 146.
Now after a reboot I have two identical lines, which presumably will screw it all up in the end.... (x.x.x.142 is the new valid IP.)
So how do I clear one of these entries?
It was created by the following command:while setting up OpenVPN on the old Pi1B.
Is there a way to:
1) List all of the iptables entries?
2) Clear specific entries from iptables? I assume that there are more because depending on some argument to iptables one can see other lines output.
Anyway, after the disk expansion issue I have now come to the OpenVPN functionality.
The Pi2B is running a disk image from a Pi1B where the OpenVPN server was already fully set up and working.
After starting up the Pi2B it naturally received a different IP address from DHCP than the original Pi1B had. So a number of config files have had to be modified accordingly.
But iptables is getting on my back!
There seems to be no configuration file at all where the iptables settings are all listed so they can be edited in a sensible way..
There is one particular item that bugs me and it can be shown as follows (command from an OpenVPN tutorial):
Code: Select all
pi@raspbian-pi2 ~ $ sudo iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
SNAT all -- 10.8.0.0/24 anywhere to:192.168.0.142
SNAT all -- 10.8.0.0/24 anywhere to:192.168.0.142
Now after a reboot I have two identical lines, which presumably will screw it all up in the end.... (x.x.x.142 is the new valid IP.)
So how do I clear one of these entries?
It was created by the following command:
Code: Select all
sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j SNAT --to-source 192.168.0.146Is there a way to:
1) List all of the iptables entries?
2) Clear specific entries from iptables? I assume that there are more because depending on some argument to iptables one can see other lines output.