zhuravskiy / wl500g

Automatically exported from code.google.com/p/wl500g
0 stars 0 forks source link

IPv6oPPP: SLAAC + DHCPv6 IA_PD: delegated prefix is not deleted during reconnect #297

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.IPv6 configuration in WebUI:
####
IPv6 Connection Type: DHCPv6
IPv6 Interface: WAN

LAN IPv6 Setting
Get IPv6 automatically? Yes
IPv6 Address:   <empty>
IPv6 Netsize:   <empty>
Advertise LAN Prefix?   Yes

WAN IPv6 Setting
Get IPv6 automatically? Yes
IPv6 Address:   <empty>
IPv6 Netsize:   <empty>
IPv6 Default Gateway:   <empty>

WAN DNSv6 Setting
Get DNS Server automatically?   Yes
DNSv6 Server1:  <empty>
####
2. DHCPv6 Reply message from BRAS contains new IA_Prefix with non-zero 
lifetimes (preferred==valid==172800 in my example)
3. Terminate PPP session somehow (I did that from BRAS side)

What is the expected output? What do you see instead?
The expected behavior:
As per my understanding old prefix has to be deleted from br0 during reconnect. 
Also CPE must withdraw this prefix from LAN using the way described below. Here 
is requirement from RFC 6204 which is possibly describe this situation (or just 
related at least):
####
   L-13:  If the delegated prefix changes, i.e., the current prefix is
          replaced with a new prefix without any overlapping time
          period, then the IPv6 CE router MUST immediately advertise the
          old prefix with a Preferred Lifetime of zero and a Valid
          Lifetime of the lower of the current Valid Lifetime and 2
          hours (which must be decremented in real time) in a Router
          Advertisement message as described in Section 5.5.3, (e) of
          [RFC4862].
####

The behavior observed:
####
# before reconnect:
[root@home ~]$ ifconfig br0
br0       Link encap:Ethernet  HWaddr E0:CB:4E:AD:ED:E2  
          inet addr:192.168.88.254  Bcast:192.168.88.255  Mask:255.255.255.0
          inet6 addr: 2a02:8040:fffe:20:e2cb:4eff:fead:ede2/64 Scope:Global
          inet6 addr: fe80::e2cb:4eff:fead:ede2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1750 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1591 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:234926 (229.4 KiB)  TX bytes:675210 (659.3 KiB)

# After reconnect:
[root@home ~]$ ip -6 addr show dev br0
7: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 
    inet6 2a02:8040:fffe:21:e2cb:4eff:fead:ede2/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 2a02:8040:fffe:20:e2cb:4eff:fead:ede2/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::e2cb:4eff:fead:ede2/64 scope link 
       valid_lft forever preferred_lft forever        
####
Packet dump from WAN-side is attached: IPv6oPPP-WAN-reconnect.1.pcap

syslog:
####
Jan 16 21:48:20 pppd[323]: Connection terminated.
Jan 16 21:48:20 pppd[323]: Connect time 2.1 minutes.
Jan 16 21:48:20 pppd[323]: Sent 246085 bytes, received 705683 bytes.
Jan 16 21:48:20 pppd[323]: Modem hangup
Jan 16 21:48:50 pppd[323]: PPP session is 202 (0xca)
Jan 16 21:48:50 pppd[323]: Connected to 00:90:1a:a4:3e:cd via interface vlan2
Jan 16 21:48:50 pppd[323]: Using interface ppp0
Jan 16 21:48:50 pppd[323]: Connect: ppp0 <--> vlan2
Jan 16 21:48:51 pppd[323]: PAP authentication succeeded
Jan 16 21:48:51 pppd[323]: peer from calling number 00:90:1A:A4:3E:CD authorized
Jan 16 21:48:51 pppd[323]: local  LL address fe80::35ed:ded1:6d6a:9550
Jan 16 21:48:51 pppd[323]: remote LL address fe80::0090:1a00:02a4:162f
Jan 16 21:48:51 dhcp6c[440]: started
Jan 16 21:48:51 pppd[323]: local  IP address 94.233.192.175
Jan 16 21:48:51 pppd[323]: remote IP address 85.175.1.63
Jan 16 21:48:51 pppd[323]: primary   DNS address 85.175.46.122
Jan 16 21:48:51 pppd[323]: secondary DNS address 85.175.46.130
Jan 16 21:48:51 dnsmasq[217]: read /etc/hosts - 3 addresses
Jan 16 21:48:51 dnsmasq[217]: using nameserver 85.175.46.130#53
Jan 16 21:48:51 dnsmasq[217]: using nameserver 85.175.46.122#53
Jan 16 21:48:51 INADYN[450]: Started 'INADYN version 1.96.3' - dynamic DNS 
updater.
Jan 16 21:48:51 INADYN[450]: IP read from cache file is '94.233.192.174'. No 
update required.
Jan 16 21:48:51 PPPoE: connected to ISP
Jan 16 21:48:51 miniupnpd[221]: already expired lease in lease file
Jan 16 21:48:52 dhcp6c[440]: unexpected DHCP6 option reconfigure accept, len 0
Jan 16 21:48:52 dhcp6c[440]: status code: success
Jan 16 21:48:52 dhcp6c[440]: add address 
2a02:8040:fffe:21:e2cb:4eff:fead:ede2/64 on br0
Jan 16 21:48:52 dnsmasq[217]: read /etc/hosts - 3 addresses
Jan 16 21:48:52 dnsmasq[217]: using nameserver 85.175.46.130#53
Jan 16 21:48:52 dnsmasq[217]: using nameserver 85.175.46.122#53
Jan 16 21:48:52 radvd[215]: attempting to reread config file
Jan 16 21:48:52 radvd[215]: resuming normal operation
####

As a result, after reconnect CPE starts sending both prefixes in ICMPv6 RA 
messages.
Packet dump from LAN-side is attached: IPv6oPPP-LAN-RA-after-reconnect.pcap

What version of the product are you using?
RT-N16-1.9.2.7-rtn-r3702.trx

Please provide any additional information below.
This issue can be somehow related with Issue 296.

Original issue reported on code.google.com by Les...@gmail.com on 16 Jan 2012 at 6:26

Attachments:

GoogleCodeExporter commented 9 years ago
One more interesting observation. 
PPP session terminates correctly every time(pppd receives LCP TermReq). But 
this issue happens sporadically. This can be kind a race condition.
Example, in which dhcp6c correctly removes old prefix from br0, is below:
####
Jan 18 23:00:57 pppd[323]: LCP terminated by peer
Jan 18 23:00:57 pppd[323]: Connect time 10.2 minutes.
Jan 18 23:00:57 pppd[323]: Sent 1243965 bytes, received 12476184 bytes.
Jan 18 23:00:57 PPPoE: Disconnected
Jan 18 23:00:57 dnsmasq[217]: read /etc/hosts - 3 addresses
Jan 18 23:00:57 dnsmasq[217]: using nameserver 85.175.46.130#53
Jan 18 23:00:57 dnsmasq[217]: using nameserver 85.175.46.122#53
Jan 18 23:00:57 dhcp6c[445]: exiting
Jan 18 23:00:57 dhcp6c[445]: sendto: Network is unreachable
Jan 18 23:00:57 dhcp6c[445]: remove address 
2a02:8040:fffe:3e:e2cb:4eff:fead:ede2/64 on br0
Jan 18 23:01:00 pppd[323]: Connection terminated.
Jan 18 23:01:00 pppd[323]: Connect time 10.2 minutes.
Jan 18 23:01:00 pppd[323]: Sent 1243965 bytes, received 12476184 bytes.
Jan 18 23:01:00 pppd[323]: Modem hangup
Jan 18 23:01:31 pppd[323]: PPP session is 237 (0xed)
Jan 18 23:01:31 pppd[323]: Connected to 00:90:1a:a4:3e:cd via interface vlan2
Jan 18 23:01:31 pppd[323]: Using interface ppp0
Jan 18 23:01:31 pppd[323]: Connect: ppp0 <--> vlan2
Jan 18 23:01:31 pppd[323]: PAP authentication succeeded
Jan 18 23:01:31 pppd[323]: peer from calling number 00:90:1A:A4:3E:CD authorized
Jan 18 23:01:31 pppd[323]: local  LL address fe80::d40a:953c:4562:efac
Jan 18 23:01:31 pppd[323]: remote LL address fe80::0090:1a00:02a4:162f
Jan 18 23:01:31 pppd[323]: local  IP address 94.233.192.207
Jan 18 23:01:31 pppd[323]: remote IP address 85.175.1.63
Jan 18 23:01:31 pppd[323]: primary   DNS address 85.175.46.122
Jan 18 23:01:31 pppd[323]: secondary DNS address 85.175.46.130
Jan 18 23:01:32 dnsmasq[217]: read /etc/hosts - 3 addresses
Jan 18 23:01:32 dnsmasq[217]: using nameserver 85.175.46.130#53
Jan 18 23:01:32 dnsmasq[217]: using nameserver 85.175.46.122#53
Jan 18 23:01:32 dhcp6c[510]: started
Jan 18 23:01:32 INADYN[515]: Started 'INADYN version 1.96.3' - dynamic DNS 
updater.
Jan 18 23:01:32 INADYN[515]: IP read from cache file is '94.233.192.206'. No 
update required.
Jan 18 23:01:32 miniupnpd[221]: already expired lease in lease file
Jan 18 23:01:32 PPPoE: connected to ISP
Jan 18 23:01:33 dhcp6c[510]: unexpected DHCP6 option reconfigure accept, len 0
Jan 18 23:01:33 dhcp6c[510]: status code: success
Jan 18 23:01:33 dhcp6c[510]: add address 
2a02:8040:fffe:3f:e2cb:4eff:fead:ede2/64 on br0
Jan 18 23:01:33 dnsmasq[217]: read /etc/hosts - 3 addresses
Jan 18 23:01:33 dnsmasq[217]: using nameserver 85.175.46.130#53
Jan 18 23:01:33 dnsmasq[217]: using nameserver 85.175.46.122#53
Jan 18 23:01:33 radvd[215]: attempting to reread config file
Jan 18 23:01:33 radvd[215]: resuming normal operation

[root@home tmp]$ date && ip -6 addr show dev br0
Wed Jan 18 23:01:43 MSK 2012
7: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 
    inet6 2a02:8040:fffe:3f:e2cb:4eff:fead:ede2/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::e2cb:4eff:fead:ede2/64 scope link 
       valid_lft forever preferred_lft forever
####

radvd

Original comment by Les...@gmail.com on 18 Jan 2012 at 7:10

GoogleCodeExporter commented 9 years ago

Original comment by lly.dev on 26 Jan 2012 at 6:41

GoogleCodeExporter commented 9 years ago
First off, please clarify your ISP configuration - are IPv6 addresses can be 
acquired via vlan2 interface even if PPP link is down? Can you provide 
/etc/dhcp6c.conf?

LAN prefix deletion should performed on WAN link down at /tmp/ppp/ipv6-down 
script call. Unfortunately, you strip first log, so it is impossible to 
understand was pppd down scripts fired or not. Can you add "debug" to 
additional pppd options field and provide log in case problematic reconnect 
(zap login/password before)?

P.S. Juniper uses unsupported in dhcp6c "reconfigure accept" option, it will be 
silently ignored in future.

Original comment by lly.dev on 8 Oct 2012 at 1:18