-
网卡配置
/etc/network/interfaces.d/eth0auto eth0 allow-hotplug eth0 iface eth0 inet static address 10.5.6.1 netmask 255.255.255.0 auto wan allow-hotplug wan iface wan inet ppp post-up /usr/sbin/iptables -t nat -A POSTROUTING -o wan -j MASQUERADE post-up /usr/sbin/iptables -t filter -A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu post-down /usr/sbin/iptables -t nat -D POSTROUTING -o wan -j MASQUERADE post-down /usr/sbin/iptables -t filter -D FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
-
PPPoE 配置
/etc/ppp/peers/providerifname wan noipdefault defaultroute connect /bin/true noauth persist noaccomp default-asyncmap plugin rp-pppoe.so eth0 user "user" lcp-echo-failure 20 lcp-echo-interval 30
-
PPPoE 帐号配置
/etc/ppp/pap-secrets# * password "user" * "password"
-
DHCP 配置
/etc/dnsmasq.confinterface=eth0 listen-address=127.0.0.1,10.5.6.1 dhcp-range=10.5.6.100,10.5.6.200,48h
-
访问光猫
# 启用 $ sudo ifconfig eth0:0 10.5.5.2 netmask 255.255.255.0 $ sudo iptables -t nat -A POSTROUTING -o eth0 -d 10.5.5.0/24 -j MASQUERADE $ sudo iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.5.5.1:80 # 关闭 $ sudo ifconfig eth0:0 down $ sudo iptables -t nat -D POSTROUTING -o eth0 -d 10.5.5.0/24 -j MASQUERADE $ sudo iptables -t nat -D PREROUTING -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.5.5.1:80
树莓派4B + Debian10 单臂路由:光猫改桥接后PPPoE自动拨号配置
最新推荐文章于 2023-08-04 10:55:46 发布