0

before the packets ports (443) entering the firewall i would like to divert incoming packet of server (443) to input chain goes to FORWARD chain so thats the incoming packets 100.43.xx.xx --sport 443 are send it to FORWARD instead of input chain and this is my nf_conntrack

tcp 6 431977 ESTABLISHED src=192.168.xx.xx dst=100.43.xx.xx sport=33575 dport=443
src=100.43.xx.xx dst=192.168.xx.xx sport=443 dport=33575 [ASSURED] mark=0 use=1

how to configure this in OUTPUT,FORWARD,POST AND PREROUTING CHAIN

my iptables rules

root@kali:~#iptables-save
-A POSTROUTING -o dms0 -j MASQUERADE
-A INPUT -i dms0 -p tcp -s 100.43.xx.xx --sport 443 -j DROP
-A INPUT -i dms0 -p udp -m multiport --sport 22,443,1080 -j ACCEPT
-A INPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
-A OUTPUT -m state --state NEW,RELATED,ESTABLISHED -j ACCEPT
root@kali:~#
0
ORIGINAL_DESTINATION='100.43.1.1'
NEW_DESTINATION='100.43.1.2'
iptables -t nat -A PREROUTING -d "$ORIGINAL_DESTINATION" -p tcp --dport 443 \
-j DNAT --to-destination "$NEW_DESTINATION"
  • Explanation needed. – kasperd Jan 14 '18 at 23:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.