-
開啟 ipv4 轉(zhuǎn)發(fā)
# 把前邊的注釋刪除 $ sudo vi /etc/sysctl.conf net.ipv4.ip_forward=1 $ sudo sysctl -p -
安裝 pppoe 和 dnsmasq
$ sudo apt update $ sudo apt install pppoeconf dnsmasq -
網(wǎng)卡配置
/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 up /usr/sbin/iptables -t nat -A POSTROUTING -o wan -j MASQUERADE 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 usepeerdns default-asyncmap plugin rp-pppoe.so eth0 user "user" lcp-echo-failure 20 lcp-echo-interval 30 -
PPPoE 帳號(hào)配置
/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 # 關(guān)閉 $ 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自動(dòng)撥號(hào)配置
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
相關(guān)閱讀更多精彩內(nèi)容
- 1、搭建vsftpd,并實(shí)現(xiàn)虛擬用戶 VSFTP介紹 VSFTP(Very Secure FTP)是一種在Unix...
- iptables簡介 netfilter/iptables(簡稱為iptables)組成Linux平臺(tái)下的包過濾防...
- 目前市面上比較常見的有3、4層的防火墻,叫網(wǎng)絡(luò)層的防火墻,還有7層的防火墻,其實(shí)是代理層的網(wǎng)關(guān)。 三層的防火墻會(huì)在...
- 一.防火墻概念 (一)安全技術(shù)介紹 (1) 入侵檢測與管理系統(tǒng)(Intrusion Detection Syste...
- 一、負(fù)載均衡LVS基本介紹 二、LVS的基本工作原理 1. 當(dāng)用戶向負(fù)載均衡調(diào)度器(Director Server...