V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
OpenWrt 是一个专门面向嵌入式设备的 Linux 发行版。你可以将 OpenWrt 支持的型号的嵌入式设备,比如各种路由器上的系统,换成一个有更多可能性可以折腾的 Linux 系统。
OpenWrt 官方网站
hhhaa
V2EX  ›  OpenWrt

原生教育网, openwrt ipv6 配置有问题,麻烦大神进来看一下

  •  
  •   hhhaa · 2016-11-25 18:12:12 +08:00 · 713 次点击
    这是一个创建于 2920 天前的主题,其中的信息可能已经有所发展或是发生改变。

    学校是 pppoe 拨号,然后 wan lan 口都能获得正常的 ipv6 地址,可是电脑连接上路由器上就没有 ipv6 访问权限,不知怎么解决,希望大神能够解决啦 这是 dhcp 配置 config dnsmasq option domainneeded '1' option boguspriv '1' option filterwin2k '0' option localise_queries '1' option rebind_protection '1' option rebind_localhost '1' option local '/lan/' option domain 'lan' option expandhosts '1' option nonegcache '0' option authoritative '1' option readethers '1' option leasefile '/tmp/dhcp.leases' option resolvfile '/tmp/resolv.conf.auto' option localservice '1'

    config dhcp 'lan' option interface 'lan' option start '100' option limit '150' option leasetime '12h' option ra 'hybrid' option dhcpv6 'hybrid' option ndp 'hybrid' option ra_management '1'

    config dhcp 'wan' option interface 'wan' option dhcpv6 'hybrid' option ra 'hybrid' option ndp 'hybrid' option master '1'

    config odhcpd 'odhcpd' option maindhcp '0' option leasefile '/tmp/hosts/odhcpd' option leasetrigger '/usr/sbin/odhcpd-update'

    这是 network 配置

    config interface 'loopback' option ifname 'lo' option proto 'static' option ipaddr '127.0.0.1' option netmask '255.0.0.0'

    config globals 'globals'

    config interface 'lan' option ifname 'eth0.1' option force_link '1' option macaddr 'f0:b4:29:88:af:ab' option type 'bridge' option proto 'static' option ipaddr '192.168.1.1' option netmask '255.255.255.0' option ip6assign '64'

    config interface 'wan' option ifname 'eth0.2' option _orig_ifname 'eth0.2' option _orig_bridge 'false' option proto 'pppoe' option username 'p25' option password '12'

    config interface 'wan6' option ifname 'eth0.2' option proto 'dhcpv6'

    config switch option name 'switch0' option reset '1' option enable_vlan '1'

    config switch_vlan option device 'switch0' option vlan '1' option ports '0 1 2 3 6t'

    config switch_vlan option device 'switch0' option vlan '2' option ports '4 6t'

    路由器:固件版本 OpenWrt Chaos Calmer 15.05.1 / LuCI 15.05-149-g0d8bbd2 Release (git-15.363.78009-956be55) 内核版本 3.18.23

    接口: 网络 状态 动作 LAN (eth0.1Master "OpenWrt"Master "Thunderbolt") br-lan 运行时间: 0h 35m 47s MAC-地址: F0:B4:29:88:AF:AB 接收: 4.20 MB (28404 数据包) 发送: 22.78 MB (28583 数据包) IPv4: 192.168.1.1/24 IPv6: 2001:250:5401:600:1144:5096:9505:44d7/64 连接 关闭 修改 删除 WAN (eth0.2) pppoe-wan 运行时间: 0h 35m 42s 接收: 21.06 MB (24573 数据包) 发送: 3.71 MB (24533 数据包) IPv4: 172.21.59.188/32 IPv6: 2001:250:5401:600:1144:5096:9505:44d7/64 连接 关闭 修改 删除 WAN6

    eth0.2 运行时间: 0h 0m 0s MAC-地址: F0:B4:29:88:AF:AB 接收: 21.45 MB (28050 数据包) 发送: 4.32 MB (26818 数据包) 连接 关闭 修改 删除

    7 条回复    2017-01-03 16:22:28 +08:00
    hhhaa
        1
    hhhaa  
    OP
       2016-11-25 18:15:35 +08:00
    这是 /etc/sysctl.conf 配置
    kernel.panic=3
    net.ipv4.conf.default.arp_ignore=1
    net.ipv4.conf.all.arp_ignore=1
    net.ipv4.ip_forward=1
    net.ipv4.icmp_echo_ignore_broadcasts=1
    net.ipv4.icmp_ignore_bogus_error_responses=1
    net.ipv4.igmp_max_memberships=100
    net.ipv4.tcp_ecn=0
    net.ipv4.tcp_fin_timeout=30
    net.ipv4.tcp_keepalive_time=120
    net.ipv4.tcp_syncookies=1
    net.ipv4.tcp_timestamps=1
    net.ipv4.tcp_sack=1
    net.ipv4.tcp_dsack=1

    net.ipv6.conf.default.forwarding=1
    net.ipv6.conf.all.forwarding=1
    net.ipv6.conf.default.accept_ra=1
    net.ipv6.conf.all.accept_ra=1

    net.netfilter.nf_conntrack_acct=1
    net.netfilter.nf_conntrack_checksum=0
    net.netfilter.nf_conntrack_max=16384
    net.netfilter.nf_conntrack_tcp_timeout_established=7440
    net.netfilter.nf_conntrack_udp_timeout=60
    net.netfilter.nf_conntrack_udp_timeout_stream=180

    # disable bridge firewalling by default
    net.bridge.bridge-nf-call-arptables=0
    net.bridge.bridge-nf-call-ip6tables=0
    net.bridge.bridge-nf-call-iptables=0

    防火墙配置(看了之前的一个 v 站的帖子,把 IP6table 防火墙给禁用了)
    config defaults
    option syn_flood '1'
    option input 'ACCEPT'
    option output 'ACCEPT'
    option forward 'ACCEPT'
    option disable_ipv6 '0'

    config zone
    option name 'lan'
    list network 'lan'
    option input 'ACCEPT'
    option output 'ACCEPT'
    option forward 'ACCEPT'

    config zone
    option name 'wan'
    list network 'wan'
    list network 'wan6'
    option output 'ACCEPT'
    option masq '1'
    option mtu_fix '1'
    option input 'ACCEPT'
    option forward 'ACCEPT'

    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'
    hhhaa
        2
    hhhaa  
    OP
       2016-11-25 18:16:11 +08:00
    这个是 ifconfig 配置
    br-lan Link encap:Ethernet HWaddr F0:B4:29:88:AF:AB
    inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
    inet6 addr: fe80::f2b4:29ff:fe88:afab/64 Scope:Link
    inet6 addr: 2001:250:5401:600:1144:5096:9505:44d7/64 Scope:Global
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:31711 errors:0 dropped:0 overruns:0 frame:0
    TX packets:32163 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:4477440 (4.2 MiB) TX bytes:23588964 (22.4 MiB)

    eth0 Link encap:Ethernet HWaddr F0:B4:29:88:AF:AB
    inet6 addr: fe80::f2b4:29ff:fe88:afab/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:31433 errors:0 dropped:1 overruns:0 frame:0
    TX packets:29958 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:22619620 (21.5 MiB) TX bytes:4810360 (4.5 MiB)
    Interrupt:5

    eth0.1 Link encap:Ethernet HWaddr F0:B4:29:88:AF:AB
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:154 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:0 (0.0 B) TX bytes:23838 (23.2 KiB)

    eth0.2 Link encap:Ethernet HWaddr F0:B4:29:88:AF:AB
    inet6 addr: fe80::f2b4:29ff:fe88:afab/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:31422 errors:0 dropped:56 overruns:0 frame:0
    TX packets:29796 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:22053280 (21.0 MiB) TX bytes:4597902 (4.3 MiB)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:65536 Metric:1
    RX packets:41 errors:0 dropped:0 overruns:0 frame:0
    TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:5448 (5.3 KiB) TX bytes:5448 (5.3 KiB)

    pppoe-wan Link encap:Point-to-Point Protocol
    inet addr:172.21.59.188 P-t-P:172.21.58.1 Mask:255.255.255.255
    inet6 addr: fe80::1144:5096:9505:44d7/10 Scope:Link
    inet6 addr: 2001:250:5401:600:1144:5096:9505:44d7/64 Scope:Global
    UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
    RX packets:27499 errors:0 dropped:0 overruns:0 frame:0
    TX packets:27209 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:3
    RX bytes:21616748 (20.6 MiB) TX bytes:3917720 (3.7 MiB)

    wlan1 Link encap:Ethernet HWaddr F0:B4:29:88:AF:AB
    inet6 addr: fe80::f2b4:29ff:fe88:afab/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:32241 errors:0 dropped:0 overruns:0 frame:0
    TX packets:32486 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:4977520 (4.7 MiB) TX bytes:24286104 (23.1 MiB)
    hikari
        3
    hikari  
       2017-01-03 01:38:59 +08:00
    不知道你解决了么?我也碰到同样的问题了..
    hhhaa
        4
    hhhaa  
    OP
       2017-01-03 08:45:44 +08:00 via Android
    @hikari 暂时放弃,有时间了再弄,
    hikari
        5
    hikari  
       2017-01-03 13:08:17 +08:00
    @hhhaa 我搞定了,不知道我的方法适不适合你,
    路由器恢复下出厂设置,之后按照 https://www.zhihu.com/question/29667477/answer/93634257 里面第一种方法做就可以了,记得要重启 odhcpd ,然后在网络 -> 接口里重新启动下 lan ,过几秒就获取到 ipv6 地址了
    hhhaa
        6
    hhhaa  
    OP
       2017-01-03 16:22:05 +08:00 via Android
    @hikari 早就试过了, lan 口都能获得 v6 地址,不过就是连不上网😂
    hhhaa
        7
    hhhaa  
    OP
       2017-01-03 16:22:28 +08:00 via Android
    @hikari 还是谢谢你呀
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2720 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 12:26 · PVG 20:26 · LAX 04:26 · JFK 07:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.