Portál AbcLinuxu, 13. března 2026 02:46
# Zmena ciloveho portu: iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 8008 \ -j REDIRECT --to-port 80 # Zmena zdrojoveho portu: iptables -t nat -A POSTROUTING -i eth1 -p tcp --sport 8008 \ -j SNAT --to 192.168.0.1:80Pravdepodobne ale chces menit cilovy port, takze plati pouze to prvni. Jinak nevim jestli tam patri tohle lomitko a nebo to druhe (kdyz se deli radek).
Zatim Ď.
## Turn on IP Forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
## Forward ports 25 and 110 on the gateway into the
## internal network for the Exchange Server.
iptables -t nat -A PREROUTING -p tcp -d 1.2.3.4 \
--dport 25 -j DNAT --to 10.0.0.2:25
iptables -t nat -A PREROUTING -p tcp -d 1.2.3.4 \
--dport 110 -j DNAT --to 10.0.0.2:110
## Make inbound connections to the Exchange Server
## appear to be from the visible IP so that the
## packets find their way back to the gateway and
## from there back onto the Internet.
iptables -t nat -A POSTROUTING -d 10.0.0.2 -j SNAT \
--to 10.0.0.1
## Enable NAT for all outgoing packets from the
## internal network to allow web browsing, etc
## from the internal network.
iptables -t nat -A POSTROUTING -s 10.0.0.0/24 \
-j SNAT --to 1.2.3.4
nebo na google hledejte iptables port forwarding ...
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.