iptables -t nat -A PREROUTING -p icmp -d $src_ip -j DNAT --to-destination $dst_ip
iptables -t nat -A POSTROUTING -p icmp --dst $dst_ip -j SNAT --to-source $src_ip
iptables -A FORWARD -p icmp -d $dst_ip -j ACCEPT
iptables -A FORWARD -p icmp -s $src_ip -j ACCEPT
iptables -t nat -A PREROUTING -p icmp -d 127.0.0.1 -j DNAT --to-destination 127.0.0.2
iptables -t nat -A POSTROUTING -p icmp --dst 127.0.0.2 -j SNAT --to-source 127.0.0.3
iptables -A FORWARD -p icmp -d 127.0.0.2 -j ACCEPT
iptables -A FORWARD -p icmp -s 127.0.0.3 -j ACCEPT
We use essential cookies to make this site work, and optional cookies to enhance your experience.