I am trying to Add Reject Rule for Outgoing traffic but I want to exclude one specific Ip address so that I can ssh. I tried adding two different rules
- sudo iptables -A OUTPUT -p tcp -d x.x.x.x/32 --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
- sudo iptables -A OUTPUT -p tcp -d x.x.x.x/22 -j REJECT --reject-with tcp-reset
I tried changing the order of rules but still I am unable to overide "Reject" Rule and ssh into x.x.x.x/32 server
iptables-save -c
. – A.B Oct 6 '20 at 22:49iptables-save -c
's output: your rules, should be provided in this question (by editing it) so people can help you with an answer. – A.B Oct 7 '20 at 16:58