How to redirect traffic from one IP to another IP
/sbin/iptables -t nat -A PREROUTING -p icmp -d 10.106.210.176 -j DNAT --to-destination 10.20.1.2
To view whatever is configured:
/sbin/iptables -t nat -vnL --line-number (with nat)
/sbin/iptables -vnL --line-number (without nat)
To Delete/remove :
/sbin/iptables -D FORWARD 1 (without nat and 'FORWARD' is the policy, replace accordingly from whatever is listed from above command output)
another example to delete with nat:
/sbin/iptables -t nat -D PREROUTING 1 (here 1, 2 ..3 are the line-numbers which will get listed from view command)
/sbin/iptables -t nat -A PREROUTING -p icmp -d 10.106.210.176 -j DNAT --to-destination 10.20.1.2
To view whatever is configured:
/sbin/iptables -t nat -vnL --line-number (with nat)
/sbin/iptables -vnL --line-number (without nat)
To Delete/remove :
/sbin/iptables -D FORWARD 1 (without nat and 'FORWARD' is the policy, replace accordingly from whatever is listed from above command output)
another example to delete with nat:
/sbin/iptables -t nat -D PREROUTING 1 (here 1, 2 ..3 are the line-numbers which will get listed from view command)