This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
hardware:gatewaynetflow [2019/01/03 13:05] veera [IPTABLES Port based NAT] |
hardware:gatewaynetflow [2019/01/07 06:15] (current) veera [How to redirect Netflow to Trisul across network segments using NAT] |
||
|---|---|---|---|
| Line 7: | Line 7: | ||
| This HOWTO explains how to use Linux IPTABLES NAT to solve the issue. | This HOWTO explains how to use Linux IPTABLES NAT to solve the issue. | ||
| + | <note>You may want to setup a GRE Tunnel instead to preserve the router IPs while also using the source IP of the gateway node, read "[[hardware:gretunnel|Setup GRE Tunnel]]"</note> | ||
| ===== IPTABLES Port based NAT ===== | ===== IPTABLES Port based NAT ===== | ||
| Line 23: | Line 24: | ||
| # Make sure ip forwarding is enabled in kernel | # Make sure ip forwarding is enabled in kernel | ||
| - | echo 1 > /proc/sys/net/ipv4/ip_forwarding | + | echo 1 > /proc/sys/net/ipv4/ip_forward |
| </code> | </code> | ||
| Line 32: | Line 33: | ||
| <code> | <code> | ||
| - | $ iptables -t nat -A PREROUTING -p udp \ | + | $ iptables -t nat -A PREROUTING -p udp --dport 2055 -j DNAT --to-destination 10.10.10.17:2055 |
| - | --dport 2055 -j DNAT --to-destination 10.10.10.17:2055 | + | |
| </code> | </code> | ||