Kod: Zaznacz cały
+--------------+
| |
+--- eth0 HOST 1 |
połączenie z / | |
internetu na / +--------------+
port 3333 / eth0: 10.0.0.100
\ / PORT: 222
\ /
\ | /
\ | eth1: 10.0.0.254 /
+-----| +-----------+ +----------+
| | | | |
+--- eth0 ROUTER eth1 --- | SWITCH |
| | | | |
+-----| +-----------+ +----------+
/ | eth0: DHCP \
/ | \
/ \
/ \
połączenie z \
internetu na \ +--------------+
port 4444 \ | |
+--- eth0 HOST 2 |
| |
+--------------+
eth0: 10.0.0.101
PORT: 222
Kod: Zaznacz cały
$IPT -A FORWARD -p TCP -i eth0 --destination-port 3333 \
--destination 10.0.0.100 -j ACCEPT
$IPT -A FORWARD -p TCP -i eth0 --destination-port 4444 \
--destination 10.0.0.101 -j ACCEPT
$IPT -t nat -A PREROUTING -p TCP -i eth0 --destination-port 3333 \
-j DNAT --to-destination 10.0.0.100:3333
$IPT -t nat -A PREROUTING -p TCP -i eth0 --destination-port 4444 \
-j DNAT --to-destination 10.0.0.101:4444