- Add rule
rdr inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080.
nc 188.8.131.52 80to confirm, the rule doesn’t take impact.
ifconfig lo0 184.108.40.206 aliasto set
220.127.116.11to the native IP, the rule will take impact.
to any can match any IP tackle, not solely native IP.
iptables -t nat -A OUTPUT -p tcp --dport 80 -j REDIRECT --to-ports 8080
We do not have to make use of the
rdr rule, if there are different mechanisms on MAC OS that may obtain the same impact, it is effective. However we have to question the unique vacation spot peer, so we’d like a question mechanism just like
ioctl(..., DIOCNATLOOK) offered by the pf rdr rule.