找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 17585|回复: 81

[k2p] 简单几步,padavan+n1当旁路由or主路由的正确姿势(可正常开启硬件加速)

 火.. [复制链接]
本帖最后由 ByByMe 于 2020-2-11 11:45 编辑

  首先是最正确的姿势,hanwckf的教程,设置vlan,k2p当交换机和ap,n1当主路由 https://www.jianshu.com/p/2d04dc1d024b 不过有人说设置了vlan后无线速度会跑不起来
  但本人有iptv单线复用的需求,家里的盒子需要直接看组播源,而padavan的vlan手动设置实在搞不定。也尝试n1接光猫拨号,k2p接光猫获取n1 ip,结果辣鸡光猫不能当交换机用。最终只能采取设置网关为n1。
  自己k2p的ip是192.168.123.1,因此设置n1的接口为192.168.123.2,网关和dns为192.168.123.1
  

  接下来的两步影响k2p的硬件加速正常启用。首先取消lan接口的桥接,记得取消后保存设置时一定要保证下面的eth0被选上。
  
  防火墙-自定义规则添加 iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE。然后重启防火墙。N1设置完成。
  
接下来是k2p的设置,更改的一共是三项。192.168.123.2已经给n1用了,起始地址改为192.168.123.3。默认网关和dns改为192.168.123.2




然后就能享受n1的性能了



2019.2.11更新
   当主路由不设置vlan的话必须要pppoe拨号,光猫拨号的可以不用看了。
   发现padavan的pppoe relay可以直接用来给下层设备拨号,因此可以开启pppoe relay,来让n1拨号。适合光猫交换机不通或者只有一个千M口的,也不会影响iptv。
  首先开启PPPOERELAY
  

  将padavan的wan随便设置成个非pppoe模式的模式,也不要直接关闭,不然看不了iptv。
  

修改n1的lan接口ip跟padavan一个网段,pppoe拨号就不要动ipv4网关和dns了,让它为空。


依然要关闭桥接,记得关闭前一定要选上eth0


修改padavan的dhcp设置,n1的ip是192.168.123.2,和上面一样,起始地址改为192.168.2.3,网关和dns改为n1的192.168.123.2


给n1创建拨号接口,协议选pppoe,接口选上eth0,创建后输入账号和密码,就能直接拨上了


查看wan接口的防火墙区域是否在wan内,以及系统防火墙设置是否如图




这个时候就能正常拨号上网了。上不了可以重新启动下路由器和n1,以免dhcp设置没有更新。


自己删过防火墙的,把以下设置粘贴到/etc/config/firewalluser,有重复的自己看着删吧
config zone
        option name 'wan'
        list network 'wan'
        list network 'wan6'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option src_ip 'fc00::/6'
        option dest_ip 'fc00::/6'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'


评分

参与人数 4恩山币 +4 收起 理由
Tenso*** + 1 感谢你的分享,无论怎样,你都是最无私的人!来,说说,你E盘上还有啥一起给我吧!
yu*** + 1 感谢你的分享,无论怎样,你都是最无私的人!来,说说,你E盘上还有啥一起给我吧!
郑载*** + 1 感谢你的分享,无论怎样,你都是最无私的人!来,说说,你E盘上还有啥一起给我吧!
拉格*** + 1 别光喝酒啊,吃菜吃菜~~~

查看全部评分

我的恩山、我的无线 The best wifi forum is right here.
 楼主| | 显示全部楼层
别听点评里说什么关桥接,开了硬件加速关桥接访问国内会异常 @tingyue-wu
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

感谢分享,条条道路通罗马!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

插眼后边试试
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

难怪之前老是取消桥接N1就无法登陆后台了。原来如此。不过我还是没有看懂单线服用的原理,能不能详细说一下。我也需要单线服用。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

使用道具 举报

 楼主| | 显示全部楼层
开始懂了~ 发表于 2020-2-11 08:16
难怪之前老是取消桥接N1就无法登陆后台了。原来如此。不过我还是没有看懂单线服用的原理,能不能详细说一下 ...

你可以简单的把vlan理解成虚拟网线,vlan号是虚拟网线的身份证号,tag表示必须配置pvid才能拿到拿到这根虚拟网线的数据,untag则是直接接受,所以一个网口可以有多个tag的vlan绑定,但是最多一个untag的vlan。光猫那给用户侧的interet iptv设置好vlan后(相当于给端口设置tag vlan),路由器这vlan Internet和vlan iptv设置好对应的数值,就可以了。假设设置的iptv vlan是3,老毛子的那个iptv stb选择lan 1后,lan1会不在处于路由器自带的vlan1的untag,而是处于vlan 3的untag(和iptv一根虚拟网线上)
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

n1的op是docker的还是实机的?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

使用道具 举报

容器的docker只要lan取消桥接,就算选好接口 填好防火墙,也会整个失联
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
dt743 发表于 2020-2-11 09:04
n1的op是docker的还是实机的?

论坛那个u盘启动的
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

dt743 发表于 2020-2-11 09:20
容器的docker只要lan取消桥接,就算选好接口 填好防火墙,也会整个失联

正解!!!!我也是这样的。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

ByByMe 发表于 2020-2-11 08:41
你可以简单的把vlan理解成虚拟网线,vlan号是虚拟网线的身份证号,tag表示必须配置pvid才能拿到拿到这根 ...

通俗易懂,感谢感谢。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

来自手机 | 显示全部楼层
hanwckf的教程搞完, 下载只有17m左右。 不知道为什么? 不划分vlan就有30-40m。纠结啊
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| | 显示全部楼层
sky_→/回头 发表于 2020-2-11 09:59
hanwckf的教程搞完, 下载只有17m左右。 不知道为什么? 不划分vlan就有30-40m。纠结啊

是不是wifi测速?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

ByByMe 发表于 2020-2-11 10:11
是不是wifi测速?

不是测速 网页,是直接 下载。连的wifi5g。。不管是外网还是局域网,速度 都 不行。但是不划分速度 就又上去了。。。搞不懂为什么 。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

本版积分规则

关闭

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

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

GMT+8, 2024-4-29 16:58

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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

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