G
G
grabbee2018-10-09 16:41:30
iptables
grabbee, 2018-10-09 16:41:30

How to disable adding iptables rule?

I took a server with a pre-installed image of Ubuntu 16.04 immediately after starting, there is such a rule in iptables-save

-A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to-source ХХ.ХХ.ХХХ.ХХХ

If I understand correctly, it is added there by some script. Instead of this rule, I need a completely different one.
-A POSTROUTING -s 10.0.0.0/8 -o ens2 -j MASQUERADE
Otherwise, my VPN refuses to give the Internet. How to do it right?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
brar, 2018-10-09
@grabbee

In debian (I think it is similar in ubuntu) the start script for iptables is placed in /etc/network/if-up.d/.

Z
Zzzz9, 2018-10-10
@Zzzz9

I first look at the table and chain numbered
sudo iptables -L -nv --line-numbers
and then remove the rule number
sudo iptables -D (table, chain) (rule number)
sudo iptables -D INPUT 3

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question