安装必须的软件包
1 | apt install -y bridge-utils dnsmasq |
添加网桥
1 | brctl addbr br0 |
打开数据报转发
1 | echo 1 > /proc/sys/net/ipv4/ip_forward |
修改 dnsmasq 配置
1 | vim /etc/dnsmasq.conf |
增加 iptbales 启动加载
1 | vim /etc/network/if-pre-up.d/iptables |
修改 iptables
1 | iptables -t nat -A POSTROUTING -o wlan -j MASQUERADE |