ubuntu iptables nat 確認 ip

$sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/255.255.0.0 -o eth0 -j MASQUERADE →◎
「10.8.0.0/255.255.0.0」からきたものはeth0宛てにNATする設定

(因みに
$iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -d 192.168.0.0/24 -j MASQUERADE,
「192.168.1.1/24」からきたものは「192.168.0.0/24」宛てにNATする設定)

$iptables -t nat -nL -v

Chain PREROUTING (policy ACCEPT 48358 packets, 2387K bytes)
pkts bytes target prot opt in out source destination

Chain INPUT (policy ACCEPT 2190 packets, 325K bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 15 packets, 1044 bytes)
pkts bytes target prot opt in out source destination

Chain POSTROUTING (policy ACCEPT 15 packets, 1044 bytes)
pkts bytes target prot opt in out source destination
0 0 MASQUERADE all -- * eth0 10.8.0.0/16 0.0.0.0/0 ←これが◎の結果