linux内网利用iptables共享上网
一 上网机器设置,wlan0为互联网连接,eth0为内网网卡
1 设置/etc/sysctl.conf
net.ipv4.io_forward=1;
2 iptables规则
sudo iptables -t nat -A POSTROUTING -s 10.0.1.0/24 -o wlan0 -j MASQUERADE
3 /etc/network/interfaces
auto eth0 iface eth0 inet static address 10.0.1.1 netmask 255.255.255.0
局域网上网机器设置
1 /etc/network/interfaces
auto eth0 iface eth0 inet static address 10.0.1.2 gateway 10.0.1.1 netmask 255.255.255.0 dns-nameservers 8.8.8.8
Leave a Reply
标签云
.htaccess 301 2010 Android apache cache cacti CSS date ddos discuz django fastcgi freebsd git google http iftop linux macos mysql nginx njava php pr python sed seo snmp ssh ubuntu ubuntu10.04 wordpress xdebug 优化 密码 文件 时区 用户 登录 监控 缓存 网站 脚本 颜色
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.
近期文章
近期评论
文章归档
链接表
QR Code
