*概要 [#mf4abdb1]
DebianをルータにしてNATする。

*IP forwardの設定 [#w406307e]
# emacs /etc/sysctl.conf
 net.ipv4.ip_forward = 1
# sysctl -p

*iptablesの記述 [#n155d89e]
 #!/bin/sh
 IPTABLES="/sbin/iptables"
 
 #NIC Define
 global='eth0'
 local='eth1'
 
 #IP address range
 local_range='192.168.1.0/24'
 any='0.0.0.0/0'
 
 #INIT
 iptables -t nat -F
 
 #ACCEPT from localnet
 $IPTABLES -A FORWARD -i $local -o $global -s $local_range -j ACCEPT
 $IPTABLES -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
 
 #for NAT
 $IPTABLES -t nat -A POSTROUTING -o $global -s $local_range -j MASQUERADE

*参考リンク [#n56e8785]
-http://www.atmarkit.co.jp/flinux/rensai/iptables02/iptables02b.html

----
&size(12){Total:&counter(total); / Today:&counter(today); / Yesterday:&counter(yesterday);};


トップ   一覧 検索 最終更新   ヘルプ   最終更新のRSS