iti lipseste destinatia unde sa forwardeze portul ?
ar trebui sa ai ceva de genul:
iptables -t nat -A PREROUTING -p tcp -i eth0 --dport 80 -j DNAT --to-destination 10.0.0.198:80
Inca un lucru, care se observa de obicei la incepatori, politica de firewall ar trebui sa o faci cam asa:
1 - default action: Deny
2 - accept ce vrei sa accepti si de la cine
3 - optional log all care nu le-ai acceptat pina la pasul asta.
Am pus si portul si tot nu merge. Acum in tabela nat am
Chain PREROUTING (policy ACCEPT 23994 packets, 2067K bytes)
num pkts bytes target prot opt in out source destination
1 3 180 DNAT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 to:10.0.0.198:80
Chain POSTROUTING (policy ACCEPT 546 packets, 33357 bytes)
num pkts bytes target prot opt in out source destination
1 87 5477 MASQUERADE all -- * eth0 10.0.0.0/24 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 229 packets, 16167 bytes)
num pkts bytes target prot opt in out source destination
iar in filter
Chain INPUT (policy DROP 7494 packets, 1683K bytes)
num pkts bytes target prot opt in out source destination
1 103 6196 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 icmp type 255
2 1374 1226K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED
3 1 60 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 state NEW tcp dpt:22
4 1168 172K ACCEPT all -- eth1 * 0.0.0.0/0 0.0.0.0/0
5 0 0 ACCEPT tcp -- eth0 * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
Chain FORWARD (policy DROP 961 packets, 58619 bytes)
num pkts bytes target prot opt in out source destination
1 463 67526 ACCEPT all -- eth1 * 0.0.0.0/0 0.0.0.0/0
2 17589 1051K ACCEPT all -- eth0 * 0.0.0.0/0 0.0.0.0/0
Chain OUTPUT (policy ACCEPT 2024 packets, 213K bytes)
num pkts bytes target prot opt in out source destination
1 19 1224 ACCEPT all -- * eth1 0.0.0.0/0 0.0.0.0/0