Raspberry3B+搭建有线路由器-实现网口转发

Raspberry3B+搭建有线路由器-实现网口转发

之前记录的,最终没有达到想要的目的,留下足迹(Raspberry3B+搭建有线路由器)

经同事共同研究,发现这个______ [___][2](原文链接暂时没找到只有整理下来的脚本,原文后面补充)

apt-get -y install hostapd dnsmasq bridge-utils

echo -e "interface eth0\nstatic ip_address=192.168.0.10/24\ndenyinterfaces eth1\ndenyinterfaces eth0" >> /etc/dhcpcd.conf
cat /etc/dhcpcd.conf

mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig
echo -e  "interface=eth0\n  dhcp-range=192.168.0.11,192.168.0.30,255.255.255.0,24h" >> /etc/dnsmasq.conf

echo -e  "interface=eth0\nbridge=br0" >> /etc/hostapd/hostapd.conf

echo -e  'DAEMON_CONF="/etc/hostapd/hostapd.conf"' >> /etc/default/hostapd
echo -e  'net.ipv4.ip_forward=1' >> /etc/sysctl.conf

iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables-save > /etc/iptables.ipv4.nat
iptables-restore < /etc/iptables.ipv4.nat
brctl addbr br0
brctl addif br0 eth1

echo -e  "auto br0\niface br0 inet manual\nbridge_ports eth1 eth0" >> /etc/network/interfaces

reboot

[2]:

你可能感兴趣的:(linux,区块链)