Warning

If it is not explicitly told in following recipe, setting up services are described for Ubuntu 20.04 server, but applications are described for Xubuntu 20.04 workstation. If you use different Ubuntu version or Linux distribution, settings as well as content, names and places of configuration files may be different!
Got it.

Portu pārsūtīšana ar iptables

Information

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 04:00
Last modified by Valdis Vītoliņš on 2025-05-10 17:44
XWiki Powered
Creative Commons Attribution 3.0 Unported License