找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 9133|回复: 70

[Debian] 树莓派4B + Debian10 单臂路由:光猫桥接模式PPPoE自动拨号配置

  [复制链接]
本帖最后由 hobin 于 2021-10-31 14:06 编辑

1. 网卡配置
/etc/network/interfaces.d/eth0
  1. auto eth0
  2. allow-hotplug eth0
  3. iface eth0 inet static
  4. address 10.5.6.1
  5. netmask 255.255.255.0

  6. auto wan
  7. allow-hotplug wan
  8. iface wan inet ppp
  9. post-up /usr/sbin/iptables -t nat -A POSTROUTING -o wan -j MASQUERADE
  10. post-up /usr/sbin/iptables -t filter -A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
  11. post-down /usr/sbin/iptables -t nat -D POSTROUTING -o wan -j MASQUERADE
  12. post-down /usr/sbin/iptables -t filter -D FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
复制代码


2. PPPoE 配置
/etc/ppp/peers/provider
  1. ifname wan
  2. noipdefault
  3. defaultroute
  4. connect /bin/true
  5. noauth
  6. persist
  7. noaccomp
  8. default-asyncmap
  9. plugin rp-pppoe.so eth0
  10. user "user"
  11. lcp-echo-failure 20
  12. lcp-echo-interval 30
复制代码


3. PPPoE 帐号配置
/etc/ppp/pap-secrets
  1. #       *       password
  2. "user" * "password"
复制代码


4. DHCP 配置
/etc/dnsmasq.conf
  1. interface=eth0
  2. listen-address=127.0.0.1,10.5.6.1
  3. dhcp-range=10.5.6.100,10.5.6.200,48h
复制代码

5. 访问光猫
  1. # 启用
  2. $ sudo ifconfig eth0:0 10.5.5.2 netmask 255.255.255.0
  3. $ sudo iptables -t nat -A POSTROUTING -o eth0 -d 10.5.5.0/24 -j MASQUERADE
  4. $ sudo iptables -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.5.5.1:80
  5. # 关闭
  6. $ sudo ifconfig eth0:0 down
  7. $ sudo iptables -t nat -D POSTROUTING -o eth0 -d 10.5.5.0/24 -j MASQUERADE
  8. $ sudo iptables -t nat -D PREROUTING -p tcp -m tcp --dport 80 -j DNAT --to-destination 10.5.5.1:80
复制代码






评分

参与人数 1恩山币 +2 收起 理由
sunju*** + 2 几个菜啊,喝成这样~~~

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
 楼主| | 显示全部楼层
@sunjun1989 这个有啥问题?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
@sunjun1989 原来那个理由是默认,新人不懂这些,感谢大佬支持!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

都光猫拨号了,还配置pppoe干嘛

点评

是光猫桥接模式,在树莓派金星拨号  详情 回复 发表于 2021-10-31 14:02
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
脱拔毛 发表于 2021-10-30 21:12
都光猫拨号了,还配置pppoe干嘛

是光猫桥接模式,在树莓派金星拨号
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

来学习这么使用
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

虽然不使用路由器,但也来学习一下,谢谢了哈。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

来自手机 | 显示全部楼层
配置了什么信息
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

这是干嘛呢
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

来自手机 | 显示全部楼层
学习学习学习
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

来自手机 | 显示全部楼层
大佬给看看。。。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

谢谢谢谢谢谢
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

来自手机 | 显示全部楼层
不错,谢谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

来自手机 | 显示全部楼层
学习学习学习学习学习学习
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

看下不知道怎么样啊
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-29 02:45

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表