LoginSignup
11
12

More than 5 years have passed since last update.

iptablesでForword(転送)設定する

Last updated at Posted at 2015-04-17

iptablesでForword(転送)設定する場合の設定忘備録

参考サイト:http://mokky14.hatenablog.com/entry/2013/12/04/143415

[root@kvm-elfinder ~]# cat /etc/sysconfig/iptables

この設定に該当すると、宛先を「10.10.10.30:123」へ変更する

-A PREROUTING -s 10.10.10.10/32 -i eth1 -p udp -m udp --dport 123 -j DNAT --to-destination 10.10.10.30:123

この設定に該当すると、ソースを「10.10.10.20」へ変更する

-A POSTROUTING -s 10.10.10.10/32 -o eth1 -p udp -m udp --dport 123 -j SNAT --to-source 10.10.10.20

COMMIT

この設定に該当すると、FORWARD する

-A FORWARD -s 10.10.10.10/32 -i eth1 -p udp -m udp --dport 123 -j ACCEPT

COMMIT

11
12
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
12