OpenWrt Forum Archive

Topic: Build for WNDR3700/WNDR3800

The content of this topic has been archived between 9 Jul 2013 and 6 May 2018. Unfortunately there are posts – most likely complete pages – missing.

I again commented that manual LAN interafce ip6addr and rebooted. Results were interesting:
It works, but instead of having a random address, the router has now ::1 set automagically as the main address. Intentional? Additionally there is now the ULA address fd...

Yes that is how its supposed to work. The lan automatically gets assigned the ::1 address (if you have a look in the log and grep for 6distributed you can see when and how the address distribution takes place). If you don't like the additional ula prefix just remove the "option ula_prefix ..." etc. than you won't get one. The ULA is mainly for local use, especially in cases when no public prefix is available and you don't want to or cannot use the link-local addresses for communication of local IPv6 devices.

Also just did a quick test with a 6in4 and it seemed to distrbute the static_prefix accordingly so I guess your problems were related to conflicting scripts or settings or so.

If you find anything else unusual please let me know.


I compiled a new firmware (with vanilla dnsmasq) and flashed it while preserving settings. After the reboot the router's LAN interface has now both the manually set ::1 and automatically set addresses:
br-lan    Link encap:Ethernet  HWaddr 76:44:xxx
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::7444:1ff:fe8d:a3e7/64 Scope:Link
          inet6 addr: 2001:xxxxx:abcd:7444:1ff:fe8d:a3e7/64 Scope:Global
          inet6 addr: 2001:xxxxx:abcd::1/64 Scope:Global

Ok what has happened here is this. You set the ::1 statically and the RD-server distribute it via RA-Messages. However the interface (br-lan) was also configured to accept RA-messages (/proc/sys/net/ipv6/conf/br-lan/accept_ra set to 2) so it basically assigned a random address based on its own RD-announcement and thus got two addresses. Normally the accept_ra shouldn't be 2 for br-lan, maybe also some confliucting scripts or a minor bug in the new logic.

(Last edited by CyrusFF on 1 Dec 2012, 11:05)

Hello,
This is a very interesting development, big thank you for that.

CyrusFF wrote:

If you have a native IPv6 connection but the upstream router doesn't support prefix delegation wan and lan are automatically put in relay mode (when not otherwise configured) meaning RD-, DHCPv6 and NDP are proxied so that both interfaces operate in the same /64.

I am in this case, with FREE TELECOM, French ISP that offers 6rd.

Here is my network6:

config interface 'wan'
    option mode 'static'
    option request_prefix 'auto'
    option prefix_fallback 'relay'
    option peerdns '1'
    list static_prefix '2a01:e34:xxxx:xxxx::/64'
    option ula_prefix 'fdd9:a5a0:f1f0::/48'

config interface 'lan'
    option mode 'downstream'
    option advertise_prefix '64'
    option relay_master 'wan'

config interface '6in4'
    option mode 'static'
    list static_prefix '2a01:e34:xxxx:xxx::/64

Here is my 6relayd:

config relay
    option network    'wan lan'
    option rd    'relay'
    option dhcpv6    'relay'
    option ndp    'relay'

I get perfectly IPv6 allocations on the LAN

Adresse IPv6: 2a01:e34:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx(préféré)
Adresse IPv6 temporaire: 2a01:e34:xxxx:xxxx:yyyy:yyyy:yyyy:yyyy(préféré)

Serveurs DNS: 2a01:e34:xxxx:xxxx::1
              192.168.1.1

But IPv6 tests still fail (http://test-ipv6.com/)

Do you find a mistake in my settings?

I got a strange error with my newest 34435 build after a "make clean": 6distributed complains at boot that "Failed to connect to ubus". That seems to come from: https://github.com/sbyx/6distributed/blob/master/src/6distributed.c#L507

The consequence is that there is no ipv6 connectivity for LAN. WAN pings from the router console pass the tunnel ok.

Strange, as there were no .config changes from 34432, which works ok. I tried with blank default settings etc., but no help. I reverted back to 34432 and I am currently doing a new build.

ipv6-support related items from system log with the erroneous 34435:

Dec  2 12:00:06 OpenWrt daemon.err 6distributed: Failed to connect to ubus
Dec  2 12:00:18 OpenWrt daemon.notice odhcp6c[1866]: Sending SOLICIT (timeout 4294967295s)

Succesful operation with 34432:

Dec  1 14:00:10 OpenWrt daemon.notice 6distributed: Invoked newiface for lan with desired prefix length 64
Dec  1 14:00:17 OpenWrt daemon.notice odhcp6c[1800]: Sending SOLICIT (timeout 4294967295s)
Dec  1 14:00:21 OpenWrt daemon.notice 6distributed: newprefix for sixxs (2001:xxxxxxx:ABCD::/64)
Dec  1 14:00:21 OpenWrt daemon.notice 6distributed: assigning address 2001:xxxxxxx:abcd::1/64 for iface br-lan: Success

Looks like a race-condition. Thanks for reporting. I will make an update to the IPv6-functionality early next week.
Upcoming changes so far:
* 6distributed will retry to connect when ubus is not yet up.
* upstream-mode will be renamed to "dhcpv6" (the old name will still work)
* downstream-mode will be renamed to "router" (the old name will still work)
* a new mode "relay" will be added

CyrusFF wrote:

Looks like a race-condition. Thanks for reporting. I will make an update to the IPv6-functionality early next week.
Upcoming changes so far:
* 6distributed will retry to connect when ubus is not yet up.

I see that you already made a patch:
https://github.com/sbyx/6distributed/commit/d779c1d5999191df32b97d36c5f3c483457e16fa

If I understand correctly, it will now wait 100 seconds and try then again. 100 seconds sounds a bit long to me. I would expect some 10-20 seconds to be enough. Could it be a TCP/IP style "doubling retry interval"? First 10 seconds, then 20, 40, 80 and so on (until maybe some ceiling).

I am currently making a build with your patch included.

hnyman wrote:

If I understand correctly, it will now wait 100 seconds and try then again.

usleep() takes microseconds, so it actually waits 0.1 seconds between each retry.

jow wrote:
hnyman wrote:

If I understand correctly, it will now wait 100 seconds and try then again.

usleep() takes microseconds, so it actually waits 0.1 seconds between each retry.

My bad :-(


EDIT:
The build r34440 includes the fix above.
http://koti.welho.com/hnyman1/Openwrt/trunk-r34440-2012-12-02/

(Last edited by hnyman on 2 Dec 2012, 13:48)

All goes well for me with the first build without RADVD (r34440).
Thanks!

- r34469: build with just the ipv6-support, radvd has been dropped

Today's changes for the ipv6-support package seem to work ok for me. I am able to switch from a Sixxs 6in4 tunnel to a Henet tunnel with Luci just by stopping one interface  and connecting the other. The distributed prefix changes automatically and my PC got the new one quickly, just like it should ;-)

EDIT:
For those, who have already tried configuring the new ipv6-support options, please note that the name of some of the options changed with r34466 https://dev.openwrt.org/changeset/34466. Also the documentation (wiki article & model /etc/config/network6 in the package has been changed.

Although the old options work for now, it is quite possible that support for them will go away at some point, as the original version of the package never got adopted very widely. I have already changed my own config to follow the new format.

My current config is below. (In /etc/config/network the Sixxs tunnel 6in4 interface is set to start at boot, while the henet tunnel requires manual action, but both can be defined in the same network6 config file.)

root@OpenWrt:/etc/config# cat network6
config interface 'lan'
        option mode 'router'
        option advertise_prefix '64'

config interface 'sixxs'
        option mode 'static'
        list static_prefix '2001:xxxx:xxxx::/48'

config interface 'henet'
        option mode 'static'
        list static_prefix '2001:xxxx:xxxx:xxxx::/64'

(Last edited by hnyman on 3 Dec 2012, 22:33)

Hello Hnyman
I stated my observations on the 6rd topic.

Like explained earlier (https://forum.openwrt.org/viewtopic.php?pid=142896#p142896) I store the settings in an encrypted file embedded in the firmware, from which file I can then extract the few files with my settings. As I am building both the Attitude Adjustment with radvd and the trunk with ipv6-support, I looked for settings that would work in both firmwares and would support both of the ipv6 config styles. Additionally, I have both Sixxs and Henet 6in4 tunnels, of which sixxs is on by default while henet is disabled.

After some research I figured the following config which works both for ipv6-support and for radvd. Otherwise it was rather easy, but the final piece in the puzzle was that the new ipv6-support package sets the LAN interface "accept_ra" automatically, while with radvd that needs to be set manually if LAN interface pick the ipv6 address from radvd.

Note that henet interface has auto=0 to disable it and henet-related radvd has ignore=1. I can toggle the tunnels easily. With ipv6-support I just stop the sixxs tunnel interface and start henet tunnel. With radvd config I need to switch the radvd ignores and then stop/start the tunnel interfaces.

EDIT: Edited in Jan 2013 to reflect the elimination of network6 config file after r35174

/etc/config/network

config 'interface' 'lan'
        option 'ifname' 'eth0.1'
        option 'type' 'bridge'
        option 'proto' 'static'
        option 'ipaddr' '192.168.1.1'
        option 'netmask' '255.255.255.0'
        option accept_ra '1'
        option 'ip6assign' '64'
...
config 'interface' 'sixxs'
        option 'proto' '6in4'
        option 'mtu' '1424'
        option 'ttl' '64'
        option 'peeraddr' '62.78.96.38'
        option 'ip6addr' '2001:db8:7777:8888::2/64'
        option 'ip6prefix' '2001:db8:2222:baba::/64'

config 'interface' 'henet'
        option 'proto' '6in4'
        option 'mtu' '1424'
        option 'ttl' '64'
        option 'peeraddr' '216.66.80.90'
        option 'ip6addr' '2001:db8:5555:6666::2/64'
        option 'ip6prefix' '2001:db8:3333:4444::/64'
        option 'tunnelid' '123456'
        option 'username' 'tb1234567890.12345678'
        option 'password' 'passwored'
        option 'auto' '0'

/etc/config/radvd

config 'interface'
        option 'interface' 'lan'
        option 'AdvSendAdvert' '1'
        option 'AdvManagedFlag' '0'
        option 'AdvOtherConfigFlag' '0'
        list 'client' ''
        option 'ignore' '0'

config 'prefix'
        option 'interface' 'lan'
        option 'AdvOnLink' '1'
        option 'AdvAutonomous' '1'
        option 'ignore' '0'
        list prefix '2001:db8:2222:baba::/64'

config 'prefix'
        option 'interface' 'lan'
        option 'AdvOnLink' '1'
        option 'AdvAutonomous' '1'
        option 'ignore' '1'
        list prefix '2001:db8:3333:4444::/64'

config 'route'
        option 'interface' 'lan'
        list 'prefix' ''
        option 'ignore' '1'

config 'rdnss'
        option 'interface' 'lan'
        list 'addr' ''
        option 'ignore' '1'

config 'dnssl'
        option 'interface' 'lan'
        list 'suffix' ''
        option 'ignore' '1'

/etc/config/firewall

config 'zone'
        option 'name' 'wan'
        option 'network' 'wan sixxs henet'
        option 'input' 'REJECT'
        option 'output' 'ACCEPT'
        option 'forward' 'REJECT'
        option 'masq' '1'
        option 'mtu_fix' '1'
...
config 'rule'
        option 'target' 'ACCEPT'
        option '_name' 'SixXS IPv6'
        option 'src' 'wan'
        option 'src_ip' '62.78.96.38'
        option 'proto' '41'

config 'rule'
        option 'target' 'ACCEPT'
        option '_name' 'HEnet IPv6'
        option 'src' 'wan'
        option 'src_ip' '216.66.80.90'
        option 'proto' '41'

Additionally, my settings extract script now resets the wireless MAC after putting the /etc/config/wireless in place by reading the MAC from the art/caldata area in flash, which enables me to use the same files for all my three routers (3700, 3700v2 and 3800). The wireless MAC is the only router-specific thing in all the Openwrt settings I have...

#!/bin/sh
cp -f $1 /tmp/HNsettings.cpt
if [ "$?" -eq 0 ] ; then
  ccdecrypt -vf /tmp/HNsettings.cpt
  if [ "$?" -eq 0 ] ; then
    tar -xzv -f /tmp/HNsettings -C /etc
  fi
fi

# Almost the same settings can be used for all my three routers
# Use hardware id to set wireless MAC address and Ipv6 segment
local name
[ -f /tmp/sysinfo/model ] && name=$(cat /tmp/sysinfo/model)
radio0=`dd if=/dev/mtdblock5 bs=1 skip=0 count=6 2>/dev/null \
  | hexdump -v -e '5/1 "%02x:" 1/1 "%02x" '`
radio1=`dd if=/dev/mtdblock5 bs=1 skip=12 count=6 2>/dev/null \
  | hexdump -v -e '5/1 "%02x:" 1/1 "%02x" '`
echo -e "------\nSet wireless MACs for $name"
echo -e "2.4 Ghz radio: $radio0\n5   GHz radio: $radio1"
uci set wireless.radio0.macaddr=$radio0
uci set wireless.radio1.macaddr=$radio1
uci commit wireless

(Last edited by hnyman on 23 Jan 2013, 18:53)

You don't even need to deal with the mac addresses, there is always the option to use "option phy phy0" for 2.4GHz and "option phy phy1" for 5GHz, instead of the "option macaddr" setting.

jow wrote:

You don't even need to deal with the mac addresses, there is always the option to use "option phy phy0" for 2.4GHz and "option phy phy1" for 5GHz, instead of the "option macaddr" setting.

Thanks for info. I tested and you are right, it works.

If there is a wrong macaddr MAC in a wifi-device section, that radio will not work, and a new wifi-device section (radio2) might be created at boot. But with that "option phy phy0" it seems to work just fine. Looks like the MAC address is then not added to the /etc/config/wireless at all. Great!

And it is even documented in the wiki rather clearly since Nov2011: http://wiki.openwrt.org/doc/uci/wireless#wifi.devices. Too bad that I haven't read that section closely enough after that addition :-(

(Last edited by hnyman on 6 Dec 2012, 21:15)

Can I replace openwrt.org with ipv6.google.com as the default test site?

Manani wrote:

Can I replace openwrt.org with ipv6.google.com as the default test site?

You mean in the Network /diagnostics page? Sure.
The page is in /usr/lib/lua/luci/view/admin_network/diagnostics.htm in a live Openwrt system.
Edit it (lines 83, 94 etc.).

(source in http://luci.subsignal.org/trac/browser/ … ostics.htm )

Works fine! Thanks

hnyman,

Does your latest build use Codel for the QoS management?

If so, how does it fare with torrents?
Any dropped packets/connections?

raz123 wrote:

Does your latest build use Codel for the QoS management?
If so, how does it fare with torrents??
Any dropped packets/connections?

Yes. Openwrt QoS module uses Codel by default at the moment.
Very well.
There are naturally some dropped packets. That is the idea...

tc -s -d qdisc show
...
qdisc fq_codel 400: dev eth1 parent 1:40 limit 10240p flows 1024 quantum 1514 target 5.0ms interval 100.0ms ecn
 Sent 2264898252 bytes 2294849 pkt (dropped 6884, overlimits 0 requeues 0)

(Last edited by hnyman on 9 Dec 2012, 17:59)

Hello Hnyman, we overcame the 6rd.
I stated my observations on the 6rd topic.

Where exactly does the ula_prefix setting derive from in LuCI? After upgrading and configuring with a totally fresh setup, I see the network6 config switch from "auto" to a specific value. This is a slave router with no connection on the WAN port, but I am surprised to see LuCI make this change.

===== network6 =====
--- /tmp/network6.default
+++ /tmp/network6.current
@@ -1,7 +1,7 @@
 package network6
 
 config global 'global'
-       option ula_prefix 'auto'
+       option ula_prefix 'fde0:3d5c:179::/48'
 
 config interface 'wan'
        option mode 'dhcpv6'