标签: pppoe

  • 华为AR系列路由器PPPOE拨号上网

    • 创建dialer接口
    acl 3998
     rule 10 permit ip
    interface Dialer1
     link-protocol ppp
     ppp ipcp default-route
     ppp chap user pppoe-user
     ppp chap password cipher 123456
     ppp pap local-user pppoe-user password cipher 123456
     ppp ipcp dns admit-any
     ppp ipcp dns request
     ipv6 enable
     tcp adjust-mss 1452
     ip address ppp-negotiate
     dialer user pppoe-user
     dialer bundle 1
     dialer number 1 autodial
     ipv6 address auto link-local
     ipv6 address auto global default
     ipv6 mtu 1492
     nat outbound 3998
     dhcpv6 client pd v6pd1
     sa application-statistic enable
    
    • 绑定pppoe会话到wan 0/0/9端口
    interface GigabitEthernet0/0/9
     pppoe-client dial-bundle-number 1
     ip address 192.168.1.2 255.255.255.0
     nat outbound 3997
     ip accounting input-packets
     ip accounting output-packets
     sa application-statistic enable
    
    • 配置lan口
    dhcpv6 pool pool1
     dns-server FD11::1
    interface Vlanif101
     mtu 1492
     ipv6 enable
     ip address 192.168.101.1 255.255.255.0
     ipv6 address v6pd1 ::1:0:0:0:1/64
     ipv6 address FD11::1/64
     ipv6 address auto link-local
     ipv6 address auto global
     ipv6 mtu 1492
     undo ipv6 nd ra halt
     ipv6 nd autoconfig other-flag
     dhcp select interface
     dhcpv6 server pool1
     dhcp server dns-list 192.168.101.1
    

    注意:
    如果ipv6不稳定可以添加以下配置:
    tcp ipv6 max-mss 1432
    在lan口上配置mtu是因为路由器的path mtu不能正常起作用,正常情况下是不需要的。

    Views: 1

  • 华为USG系列防火墙PPPOE拨号上网

    • 创建dialer接口
    interface Dialer0
     link-protocol ppp
     ppp chap user pppoe-user
     ppp chap password cipher 123456
     ppp pap local-user pppoe-user password cipher 123456
     ppp ipcp dns admit-any
     mtu 1492
     ipv6 enable
     ip address ppp-negotiate
     dialer user pppoe-user
     dialer bundle 1
     dialer number 0 autodial
     ipv6 address auto link-local
     ipv6 address auto global
     ipv6 mtu 1492
     healthcheck wan0
     service-manage https permit
     service-manage ssh permit
     redirect-reverse
     ipv6 redirect-reverse
     dhcpv6 client pd v6pd1
    
    • 创建健康检查
    healthcheck name wan0
    destination 223.5.5.5 interface Dialer0  protocol dns
    
    • 创建NAT
    nat-policy
     rule name Internet
      source-zone 办公网
      egress-interface Dialer0
      action source-nat easy-ip
    
    • 创建默认路由
    ip route-static 0.0.0.0 0 Dialer0
    ipv6 route-static :: 0 Dialer0
    
    • 绑定pppoe会话到wan0口
    interface WAN0/0/0
     pppoe-client dial-bundle-number 1
     undo shutdown
     anti-ddos flow-statistic enable
     service-manage https permit
     service-manage ssh permit
    
    • 配置lan口
    dhcpv6 pool pool1
     dns-server FD06::1
    interface Vlanif6
     ipv6 enable
     ip address 192.168.2.1 255.255.255.0
     ipv6 address v6pd1 ::1:0:0:0:1/64
     ipv6 address FD06::1/64
     ipv6 address auto link-local
     ipv6 address auto global
     ipv6 mtu 1492
     undo ipv6 nd ra halt
     ipv6 nd autoconfig other-flag
     alias Vlanif6
     service-manage http permit
     service-manage https permit
     service-manage ping permit
     service-manage ssh permit
     dhcp server mask 255.255.255.0
     dhcp server ip-range 192.168.2.1 192.168.2.254
     dhcp select interface
     dhcpv6 server pool1
     dhcp server gateway-list 192.168.2.1
     dhcp server dns-list 192.168.2.1
    

    注意:
    如果拨号成功后ipv6不通,可以删除并重新配置以下命令:

     ipv6 address auto link-local
     ipv6 address auto global
     dhcpv6 client pd v6pd1
    

    如果ipv6上网不稳定还可以配置以下命令:

    tcp ipv6 max-mss 1432
    

    Views: 1

  • PPPOE的MTU协商

    PPPOE是支持MTU自动协商的,可以双方互相通告自己的MRU,IPv4 MTU是通过PPP LCP协商的。
    LCP抓包

    IPv6 MTU是通过ICMP RA协商的
    ICMP RA抓包

    RA报文只看到了单向的MTU通告。
    虽说PPPOE完全支持MTU协商,但有些路由器并不一定能正确处理MTU。

    参考:
    https://support.huawei.com/enterprise/zh/doc/EDOC1100278529/e6deca7e#ZH-CN_CONCEPT_0172358961

    Views: 2

  • IPV6CP协议

    PPPOE接入IPv4协议栈用的是IPCP协议,IPCP可以分配IPv4地址和DNS服务器,但是不支持IPv6协议,所以就有了IPV6CP协议。
    PPP连接建立后开始执行IPPCP和IPV6CP协议,IPV6CP目前仅定义了接口标识和IPV6压算法(主要是IPv6头压缩),不过目前很少有支持压缩的,所以本文主要说接口标识协商。
    通过Wireshark抓包发现,PPPOE建立连接后会互相发送附带本机接口标识的Request请求给对方,对方收到后会回复Ack包,ack包会携带Request包中的接口标识。

    RFC5072中并没有明确指定接口标识符的生成规则,原话是:

    If an IEEE global identifier is not available, a different source of uniqueness should be used. Suggested sources of uniqueness include link-layer addresses, machine serial numbers, et cetera. In this case, the “u” bit of the interface identifier MUST be set to zero (0).
    If a good source of uniqueness cannot be found, it is recommended that a random number be generated. In this case, the “u” bit of the interface identifier MUST be set to zero (0).

    翻译过来就是可以使用唯一性的链路层地址,机器序列号等,如果没有好的唯一性来源推荐使用随机数来生成。经过测试openwrt和华为AR系列路由器都是用的随机生成,每次拨号接口标识符都会变化。
    IPV6CP协商完成后本端和对端都获得了自己的链路层IPv6地址,并且也知道对方的链路层地址,下一步就可以用ICMP RA或DHCPv6来分配IPv6网络参数了。

    参考:
    IPv6CP主机标识协商
    https://datatracker.ietf.org/doc/rfc5072/
    IPv6CP压缩协议协商
    https://datatracker.ietf.org/doc/rfc5172/
    IPCP
    https://datatracker.ietf.org/doc/rfc1332/

    Views: 4

  • 华为路由器PPPOE拨号IPv6不稳定

    表现为IPv6速度慢,有的网站能打开,有的打不开。

    #pppoe口
    int Dialer 1
      mtu 1492
      ipv6 mtu 1492
    #lan口
    int vlanif 2
      mtu 1492
      ipv6 mtu 1492
    

    造成这种问题是原因多方面的:
    – IPv6天生不允许分片
    – 华为路由器的MTU,IPv4和IPv6是分开配置的,PPPOE会自动配置IPv4的MTU为1492,但IPv6不会
    – ipv6 pathmtu被某些设备破坏了或者某些网站pathmtu不正确

    正常情况下IPv6是不需要设置MTU的,IPv6始终使用Path MTU Discovery自动发现正确的MTU,出现这种情况大概率华为设备的PMTUD协议有问题,这种问题仅在华为设备上出现。
    OpenWrt就是有项RA MTU的设置,会把PPPOE接口的MTU通告给下游设备。

    参考:
    https://macgeeker.com/openwrt/ipv6-mtu/
    https://forum.huawei.com/enterprise/zh/thread/blog/703813366742663168

    Views: 4