| 1 |
zone { |
| 2 |
localhost |
| 3 |
public |
| 4 |
} |
| 5 |
|
| 6 |
prerouting { |
| 7 |
# Use lower 8 bits to mark tproxy traffic |
| 8 |
mark_match -0x00/0xff # Anti-loop protection |
| 9 |
|
| 10 |
# Specific IPv4 port only. My own IP is 192.168.0.1 so that |
| 11 |
# sysctl net.ipv4.conf.eth0.route_localnet=1 is not needed. |
| 12 |
tcp 8888 tproxy 192.168.0.1:18888 mark_set 0x01/0xff |
| 13 |
|
| 14 |
# All IPv4 TCP traffic, does not match IPv6 |
| 15 |
tcp tproxy 192.168.0.1:12345 mark_set 0x02/0xff |
| 16 |
|
| 17 |
# All IPv4 and IPv6 TCP traffic |
| 18 |
tcp tproxy 192.168.0.1:42424 [::1]:42424 mark_set 0x03/0xff |
| 19 |
} |