IP MASQ

IP Masquerade の環境を potato で kernel 2.2 なサーバで再構築した。今までずっと ipfwadm な wrapper を使っていたので、初めての ipchains である。/etc/network/options を ip_forward=yes して、/etc/network/interfaces に以下の行を追加した。

up ipchains -P forward DENY
up ipchains -A forward -s 192.168.1.0/255.255.255.0 -j MASQ
up modprobe ip_masq_ftp
down rmmod ip_masq_ftp
down ipchains -F

ipchains の設定を確認するには ipchains -L らしい。

# ipchains -L
Chain input (policy ACCEPT):
Chain forward (policy DENY):
target     prot opt     source                destination           ports
MASQ       all  ------  192.168.1.0/24       anywhere              n/a
Chain output (policy ACCEPT):