linux_iptables_常用策略
差别
这里会显示出您选择的修订版和当前版本之间的差别。
| linux_iptables_常用策略 [2011/10/31 22:11] – 创建 admin | linux_iptables_常用策略 [2011/11/05 15:52] (当前版本) – [使用 Linux 做无线路由器] indent alex | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| + | ====== Linux iptables 常用策略 ====== | ||
| + | ===== 使用 Linux 做无线路由器 ===== | ||
| + | |||
| + | <code bash> | ||
| + | ifconfig wlan0 down | ||
| + | iwconfig wlan0 mode ad-hoc | ||
| + | iwconfig wlan0 essid " | ||
| + | ifconfig wlan0 10.4.250.1 netmask 255.255.255.0 | ||
| + | iptables -F | ||
| + | iptables -P INPUT ACCEPT | ||
| + | iptables -P FORWARD ACCEPT | ||
| + | iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE | ||
| + | echo 1 > / | ||
| + | / | ||
| + | </ | ||
| + | ===== 使用 Linux 进行 NAT ===== | ||
| + | |||
| + | '' | ||
| + | |||
| + | ===== 使用 Linux 进行强制 Portal 认证 ===== | ||
| + | |||
| + | < | ||
| + | iptables -t nat -I PREROUTING -i ppp+ -d \! 10.16.0.0/ | ||
| + | iptables -I FORWARD -i tun+ -d \! 10.16.0.0/ | ||
| + | iptables -I FORWARD -i tun+ -d \! 10.16.0.0/ | ||
| + | </ | ||
