ポートフォワード

サーバアドレス

現在の状態の確認

# iptables -t nat -L -v

Chain PREROUTING (policy ACCEPT 98804 packets, 16M bytes)

 pkts bytes target     prot opt in     out     source               destination


  33  1576 DNAT       tcp  --  eth0   any     anywhere             anywhere

       tcp dpt:591 to:192.168.1.121:80

  51  2448 DNAT       tcp  --  eth0   any     anywhere             anywhere

       tcp dpt:fmj to:192.168.1.121:5003


Chain POSTROUTING (policy ACCEPT 8816 packets, 1247K bytes)

 pkts bytes target     prot opt in     out     source               destination



Chain OUTPUT (policy ACCEPT 8732 packets, 1243K bytes)

 pkts bytes target     prot opt in     out     source               destination


/etc/services


tfido           60177/udp                       # Ifmail

fido            60179/tcp                       # Ifmail

fido            60179/udp                       # Ifmail


# Local services

fmj             5003/tcp ファイルメーカ使用ポート

iptables command

#iptables -t nat -i eth1 -A PREROUTING -p tcp --dport 6515 -j DNAT --to 192.168.90.165:6515

windows remote desktop iptable 追加コマンド

#iptables -t nat -i eth0 -A PREROUTING -p tcp --dport 3389 -j DNAT --to 192.168.1.121:3389

ポートフォワードを有効化

# /etc/sysctl.conf - Configuration file for setting system variables

# See sysctl.conf (5) for information.

#

#kernel.domainname = example.com

#net/ipv4/icmp_echo_ignore_broadcasts=1

net.ipv4.ip_forward = 1

sudo sysctl -p

設定を保存

sudo /etc/init.d/iptables save active