Note, that this recipe is not updated long time and could be outdated!
Got it.

Portu pārsūtīšana ar iptables

Ja izmanto serveri (piemēram, Tomcat), kas klausās uz nestandarta porta, var izmantot IP pakešu pārsūtīšanu ar iptables.

Lai pārsūtītu paketes no 80 porta uz 8080 portu, ievada komandas:

iptables -t nat -A OUTPUT -d 127.0.0.1 -p tcp --dport 80 -j REDIRECT --to-ports 8080;
iptables -t nat -A OUTPUT -d host_address -p tcp --dport 80 -j REDIRECT --to-ports 8080;
iptables -t nat -A PREROUTING -d host_address -p tcp --dport 80 -j REDIRECT --to-ports 8080;

kur host_address ir datora saskarnes adrese


  
Tags Linux Tīkls
Created by Valdis Vītoliņš on 2012-08-24 07:00
Last modified by Valdis Vītoliņš on 2021-04-13 14:30
 
Xwiki Powered
Creative Commons Attribution 3.0 Unported License