User Tools

Site Tools


hardware:gatewaynetflow

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
hardware:gatewaynetflow [2019/01/03 17:36] – [How to redirect Netflow to Trisul across network segments using NAT] veerahardware:gatewaynetflow [2019/01/03 18:33] – [Shutdown ufw or disable firewalld] veera
Line 11: Line 11:
 On the gateway device you just need to run the following commands, say you want to move port 2055 to a particular IP. On the gateway device you just need to run the following commands, say you want to move port 2055 to a particular IP.
  
-Shutdown ufw or disable firewalld+==== Shutdown ufw or disable firewalld ==== 
 + 
 +since we are working directly with iptables. 
  
 <code  bash> <code  bash>
Line 25: Line 27:
  
  
-Then setup the Port NAT+==== Then setup the Port NAT ==== 
 + 
 +The following commands move port 2055 to the Trisul IP (see the diagram above) .
  
 <code> <code>
-$ iptables -t nat -A PREROUTING -p udp --dport 2055 -j DNAT --to-destination 10.10.10.17:2055 +$ iptables -t nat -A PREROUTING -p udp 
-$ iptables -t nat -A POSTROUTING -j MASQUERADE+    --dport 2055 -j DNAT --to-destination 10.10.10.17:2055
 </code> </code>
  
  
 You should now be seeing Netflow  flowing to the Trisul box. You should now be seeing Netflow  flowing to the Trisul box.
 +
 +
 +<note important>NOTE: Do not use the MASQUERADE POSTROUTING rule, because we want to preserve the Source IP address of the original router in the netflow packets. Otherwise Trisul can  assume that the Gateway device is the router.
 +</note>
 +==== Useful commands ====
 +
 +To view NAT rules with counters
 +''
 +iptables -t nat -vL
 +
 +''
 +==== Reference ====
 +
 +How to redirect incoming traffic on a port to another IP https://my.esecuredata.com/index.php?/knowledgebase/article/49/how-to-redirect-an-incoming-connection-to-a-different-ip-address-on-a-specific-port-using-iptables/ 
  
  
  
hardware/gatewaynetflow.txt · Last modified: 2019/01/07 11:45 by veera