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.

The pptp client setup registers a host route dependency with netifd, as soon as a default route (or a smaller subnet route covering the vpn server ip) becomes available, the pptp iface is brought up.
Problem is that the resolving of the symbolic vpn server hostname to ips happens directly on setup and is not deferred, therefore the mechanism might fail due to no available dns but would otherwise work as intended when using the server ip directly.

OK - makes sense. 

I tried it with an IP Address, and get the same problem.  Looking at the systemlog from the boot, it looks like its not loading the PPTP until after the interface is up, but it never actually creates the connection.


Jun 18 19:33:06 RouterTest daemon.notice netifd: Interface 'lan' is now up
Jun 18 19:33:06 RouterTest daemon.notice netifd: Interface 'loopback' is now up
Jun 18 19:33:06 RouterTest kern.info kernel: [   37.880000] ADDRCONF(NETDEV_UP): eth1: link is not ready
Jun 18 19:33:07 RouterTest daemon.notice netifd: wan (775): udhcpc (v1.19.4) started
Jun 18 19:33:07 RouterTest daemon.notice netifd: Interface 'MYVPN' is now down
Jun 18 19:33:07 RouterTest daemon.notice netifd: wan (775): Sending discover...
Jun 18 19:33:07 RouterTest user.info sysinit: 'radio0' is disabled
Jun 18 19:33:07 RouterTest user.info sysinit: 'radio1' is disabled
Jun 18 19:33:08 RouterTest user.notice ifup: Enabling Router Solicitations on lan (br-lan)
Jun 18 19:33:08 RouterTest user.info sysinit: 'radio0' is disabled
Jun 18 19:33:08 RouterTest user.info sysinit: 'radio1' is disabled
Jun 18 19:33:08 RouterTest kern.info kernel: [   39.850000] br-lan: port 1(eth0.1) entered forwarding state
Jun 18 19:33:10 RouterTest daemon.notice netifd: wan (775): Sending discover...
Jun 18 19:33:10 RouterTest user.notice upnp daemon: external interface not found, not starting
Jun 18 19:33:10 RouterTest user.info sysinit: Loading defaults
Jun 18 19:33:10 RouterTest kern.debug kernel: [   41.850000] ar71xx: pll_reg 0xb8050014: 0x11110000
Jun 18 19:33:10 RouterTest kern.info kernel: [   41.850000] eth1: link up (1000Mbps/Full duplex)
Jun 18 19:33:10 RouterTest kern.info kernel: [   41.880000] ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
Jun 18 19:33:11 RouterTest user.info sysinit: Loading synflood protection
Jun 18 19:33:11 RouterTest user.info sysinit: Adding custom chains
Jun 18 19:33:12 RouterTest user.notice ifup: Enabling Router Solicitations on loopback (lo)
Jun 18 19:33:12 RouterTest user.info sysinit: Loading zones
Jun 18 19:33:13 RouterTest daemon.notice netifd: wan (775): Sending discover...
Jun 18 19:33:13 RouterTest daemon.notice netifd: wan (775): Sending select for Z.Z.Z.Z (removed)...
Jun 18 19:33:13 RouterTest daemon.notice netifd: wan (775): Lease of Z.Z.Z.Z (removed) obtained, lease time 176571
Jun 18 19:33:13 RouterTest daemon.notice netifd: Interface 'wan' is now up
Jun 18 19:33:14 RouterTest daemon.info pppd[1455]: Plugin pptp.so loaded.
Jun 18 19:33:14 RouterTest daemon.info pppd[1455]: PPTP plugin version 1.00
Jun 18 19:33:14 RouterTest daemon.notice pppd[1455]: pppd 2.4.5 started by root, uid 0

Jun 18 19:33:14 RouterTest user.notice ifup: Allowing Router Advertisements on wan (eth1)
Jun 18 19:33:14 RouterTest user.info sysinit: Loading forwardings
Jun 18 19:33:14 RouterTest user.info sysinit: Loading rules
Jun 18 19:33:15 RouterTest user.info sysinit: Loading redirects
Jun 18 19:33:15 RouterTest user.info sysinit: Loading includes
Jun 18 19:33:15 RouterTest user.info sysinit: Loading interfaces
Jun 18 19:33:15 RouterTest user.info firewall: adding lan (br-lan) to zone lan
Jun 18 19:33:15 RouterTest daemon.info pppd[1455]: Using interface pptp-MYVPN
Jun 18 19:33:15 RouterTest daemon.notice pppd[1455]: Connect: pptp-MYVPN <--> pptp (y.y.y.y) (removed)

Jun 18 19:33:16 RouterTest user.info syslog: SNet version started

And then there are no more pppd/pptp messages.  If I immediately go to manually connect it through LUCI, then it comes straight up (end addresses removed).

Jun 18 19:39:00 RouterTest daemon.info pppd[1455]: Terminating on signal 15
Jun 18 19:39:00 RouterTest daemon.notice pppd[1455]: Connection terminated.
Jun 18 19:39:00 RouterTest daemon.info pppd[1455]: Exit.
Jun 18 19:39:00 RouterTest daemon.notice netifd: Interface 'MYVPN' is now down
Jun 18 19:39:00 RouterTest daemon.info dnsmasq[2083]: reading /tmp/resolv.conf.auto
Jun 18 19:39:00 RouterTest daemon.info dnsmasq[2083]: using nameserver 75.75.75.75#53
Jun 18 19:39:00 RouterTest daemon.info dnsmasq[2083]: using nameserver 75.75.76.76#53
Jun 18 19:39:00 RouterTest daemon.info dnsmasq[2083]: using local addresses only for domain lan
Jun 18 19:39:00 RouterTest daemon.info pppd[2645]: Plugin pptp.so loaded.
Jun 18 19:39:00 RouterTest daemon.info pppd[2645]: PPTP plugin version 1.00
Jun 18 19:39:00 RouterTest daemon.notice pppd[2645]: pppd 2.4.5 started by root, uid 0
Jun 18 19:39:01 RouterTest daemon.info pppd[2645]: Using interface pptp-MYVPN
Jun 18 19:39:01 RouterTest daemon.notice pppd[2645]: Connect: pptp-MYVPN <--> pptp (y.y.y.y)
Jun 18 19:39:02 RouterTest daemon.notice pppd[2645]: CHAP authentication succeeded
Jun 18 19:39:02 RouterTest daemon.notice pppd[2645]: MPPE 128-bit stateless compression enabled
Jun 18 19:39:02 RouterTest daemon.notice pppd[2645]: local  IP address x.x.x.156
Jun 18 19:39:02 RouterTest daemon.notice pppd[2645]: remote IP address x.x.x.1
Jun 18 19:39:03 RouterTest daemon.notice netifd: Interface 'MYVPN' is now up
Jun 18 19:39:03 RouterTest user.notice ifup: Enabling Router Solicitations on MYVPN (pptp-MYVPN)
Jun 18 19:39:03 RouterTest user.info firewall: adding MYVPN (pptp-MYVPN) to zone wan

(Last edited by Dickie on 19 Jun 2012, 03:49)

This does not appear to be a race condition, the order on my test installation is the same.

I have included the newly enabled support for 6rd connections to my r32462 trunk build. There is not yet any LuCI support, so only manual config is available. But it might still work. If anybody has 6rd connectivity, please test it and report bugs, so that Jow gets feedback. See https://dev.openwrt.org/changeset/32431 for more info.

Unless there are any critical errors found in the next 24 hours, this is probably the last build before late July.

jow wrote:

This does not appear to be a race condition, the order on my test installation is the same.

Did some more testing today, and seems to be consistent rather than a timing / occasional failure.
Is there any underlying dependency with dnsmasq? 
The only reason I ask is if you look at the boot log the pptp extension is loaded, the connection start, and then nothing happens - its followed shortly afterwards by dnsmasq starting up.
When you look at the manual connect version the first thing that happens after the connection initiates is dnsmasq reports using /tmp/resolv.conf.auto  (this is with both IP and hostname targets).

The only other thing I may change is that I have the PPTP and the WAN interface in the same firewall zone (which isn't enabled until Eth1 comes up), but dont think this looks like a filtering issue.

(Last edited by Dickie on 19 Jun 2012, 20:48)

The only thing I could imagine is that GRE frames are blocked somehow. Maybe enable the firewall logging options and see how much stuff is rejected until the wan rules are brought up?

jow wrote:

The only thing I could imagine is that GRE frames are blocked somehow. Maybe enable the firewall logging options and see how much stuff is rejected until the wan rules are brought up?

So I moved the interface into the 'unspecified' firewall zone and now its working perfectly after a reboot. 
I'll play around when I get more time to see if putting it in its own zone (rather than it being bound to the Eth1) works just as well, but for now we're all up and running perfectly.  Thanks again for taking the time to lend some brain power to this.

Update: Ok , after further testing its clearly the zone config.  I put the PPTP interface in its own zone, and it comes up correctly during boot and after the ETH1 interface is up.  :-)

(Last edited by Dickie on 20 Jun 2012, 02:05)

When can we expect a new build of the Attitude Adjustment trunk version? I need to install some extra's like ebtables, kmod-ebtables and kmod-macvlan, but they won't install due tue kernel version conflicts.

bibabart wrote:

When can we expect a new build of the Attitude Adjustment trunk version? I need to install some extra's like ebtables, kmod-ebtables and kmod-macvlan, but they won't install due tue kernel version conflicts.

Like I wrote on June 19th: https://forum.openwrt.org/viewtopic.php?pid=170427#p170427

hnyman wrote:

... this is probably the last build before late July.

I will be able to build the next version around July 20th.

hnyman wrote:

... this is probably the last build before late July.
I will be able to build the next version around July 20th.

I am successfully building against the latest trunk using hnyman's original config - so if you need it, and can give me somewhere to upload it...

Trunk build has been udpated to r32765.

I will probably stop doing Backfire builds soon, as there have been almost no changes lately and as the trunk "Attitude Adjustment" nears release. It is possible that Backfire is retired when AA is released, but devs have not yet made any formal decisions about that. https://lists.openwrt.org/pipermail/openwrt-devel/2012-August/016427.html

After the release AA will most likely be the new stable branch, and I will probably build both AA and the new trunk from that point onward. Not quite sure yet. Depends a bit from the exact SVN branching after the forthcoming AA release.

Hnyman, thank you for these builds.

After noticing that Jow today enabled support for showing dhcpv6 leases in Luci, I made a new private test build where I replaced radvd module with dnsmasq's built-in ipv6 RA functionality, which was added in the recent 2.62 version as 'dnsmasq-dhcpv6' variant.

There is no uci config support for that, yet, so I made a rather crude hack to /etc/init.d/dnsmasq to insert the correct line to dnsmasq config. The following line makes dnsmasq to perform router advertisements for stateless autoconfig for LAN with the given prefix:

+++ /etc/init.d/dnsmasq
@@ -501,6 +502,8 @@
        echo >> $CONFIGFILE
        config_foreach dhcp_cname_add cname
        echo >> $CONFIGFILE
+
+       echo "dhcp-range=2001:1111:2222:abcd::, ra-names" >> $CONFIGFILE

        # add own hostname
        [ $ADD_LOCAL_HOSTNAME -eq 1 ] && [ -n "$lanaddr" ] && {

Dnsmasq accepted that happily. I turned radvd off and IPv6 still worked, as PC autoconfigured itself using dnsmasq's RA functionality. (But apparently the autoconfigured ipv6 addresses are not shown in Luci's DHCPv6 list, as they are no formal leases, so no change there.)

There was related discussion in openwrt-devel in July and even a rather elegant uci based config example in patch attachment: https://lists.openwrt.org/pipermail/openwrt-devel/2012-July/015906.html

dnsmasq config line examples: http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq.conf.example

Currently radvd is still the easier and better supported way for providing ipv6 router advertisements and stateless autoconfiguration, but as Openwrt aims for small footprint, it is quite possible that sooner or later the built-in support in dnsmasq is enabled by default and radvd is pushed to sidelines.

Radvd nicely determines the correct ipv6 prefix from LAN interface's address, but dnsmasq seems to require a prefix or address (without prefix length) in the config statement. So, providing that in the config script requires minor coding.

-------------
EDIT:
I made a more elegant uci based version. The following code reads an optional 'raprefix' option from /etc/config/dhcp. For each interface with that option, dnsmasq wiil be configured to act as stateless ra provider for that interface using that prefix. It would be even more elegant to sniff the correct prefix from LAN ipv6 address, but I didn't implement that, yet.

root@OpenWrt:/etc/init.d# diff /rom/etc/init.d/dnsmasq dnsmasq
--- /rom/etc/init.d/dnsmasq
+++ dnsmasq
@@ -367,6 +367,11 @@
        xappend "--dhcp-range=$networkid,$START,$END,$NETMASK,$leasetime${options:+ $options}"

        dhcp_option_add "$cfg" "$networkid"
+
+       config_get raprefix "$cfg" raprefix
+       [ -n "$raprefix" ] && {
+               xappend "--dhcp-range=$networkid,$raprefix,ra-names"
+       }
 }

 dhcp_option_add() {

Extract from /etc/config/dhcp:

config 'dhcp' 'lan'
        option 'interface' 'lan'
        option 'start' '100'
        option 'limit' '150'
        option 'leasetime' '12h'
        option 'force' '1'
        option 'raprefix' '2001:1111:2222:abcd::'

System log:

Aug 18 13:57:10 OpenWrt daemon.info dnsmasq[5391]: started, version 2.62 cachesize 150
Aug 18 13:57:10 OpenWrt daemon.info dnsmasq[5391]: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack
Aug 18 13:57:10 OpenWrt daemon.info dnsmasq-dhcp[5391]: DHCP, IP range 192.168.1.100 -- 192.168.1.249, lease time 12h
Aug 18 13:57:10 OpenWrt daemon.info dnsmasq-dhcp[5391]: DHCPv4-derived IPv6 names on 2001:1111:2222:abcd::
Aug 18 13:57:10 OpenWrt daemon.info dnsmasq-dhcp[5391]: SLAAC on 2001:1111:2222:abcd:: prefix valid 2h

Ps. The dhcpv6 support in dnsmasq seems to increase its uncompressed size by 30 kB, which is much less than radvd.

(Last edited by hnyman on 18 Aug 2012, 13:16)

There seems to a be a bug in USB hotplug unmounting, which prevents some USB drives being logically unmounted when they are removed. That will lead into mount problems when a disk is attached the next time. I have added a short-term fix to my build while waiting the devs figure out a more permanent solution. See https://dev.openwrt.org/ticket/12056 (and https://dev.openwrt.org/ticket/12043)

I remembered an old about processor-specific gcc compiler optimizations in Arokh's thread and decided to experiment a bit. References to the earlier discussions:
https://forum.openwrt.org/viewtopic.php?pid=161348#p161348
https://forum.openwrt.org/viewtopic.php?pid=160079#p160079

As I compile firmware only for WNDR3700v1/v2/3800 family, which all have similar processors, I can tailor the optimization to be processor-specific. Instead of leaving the code suitable for the whole 'mips32r2' CPU series, I can set it to support specifically this router's '24kc' processors. Original config is "-Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves" and comes from https://dev.openwrt.org/browser/trunk/target/linux/ar71xx/Makefile#L13

I did the optimization by adding a few lines to my config (can be also done through menuconfig):

CONFIG_DEVEL=y
CONFIG_TARGET_OPTIONS=y
CONFIG_TARGET_OPTIMIZATION="-Os -pipe -march=24kc -mtune=24kc -fno-caller-saves"

I used the Openssl benchmark for measuring the CPU power. It can be found in Wiki:
http://wiki.openwrt.org/inbox/benchmark.openssl

The improvement was quite large for most measurements. The older v1 has practically identical kernel & build version and the CPU optimizations. It clearly beats the v2 which has no optimizations:

WNDR3700v1 / r33288 / -march=24kc  -mtune=24kc
| 1.0.1c |  33849080 |  11416910 |  8066650 |  4917620 |  5249110 |  1875610 |  9133810 |  7940310 |  7051220 |  7.5 |  256.9 |  25.9 |  21.4 |

WNDR3700v2 / r33275 / -mips32r2  -mtune=mips32r2
| 1.0.1c |  33704030 |  11410380 |  7957250 |  4804920 |  4865770 |  1768170 |  8224980 |  7162790 |  6426480 |  6.0 |  205.1 |  20.6 |  16.7 |

This CPU optimization should help especially CPU-heavy tasks, e.g. all encryption related stuff. I have not yet uploaded the new version to the FTP server, but if I do not find any drawbacks in real-life use in the next few days, I will probably leave that optimization on.

Sounds promising, but are those two results from the same processor? The 24kc one says 3700v1 but the mips32r2 one says 3700v2.

tt wrote:

Sounds promising, but are those two results from the same processor? The 24kc one says 3700v1 but the mips32r2 one says 3700v2.

That line is the used code optimization. v1 was optimized for 24kc, while v2 had the standard mips32r2 code. The results are highlighting the difference that the code optimization makes.

Ah! I thought those were the two WNDR model # variants, 3700v2 being the newer unit. :-)

That's a surprising improvement. I guess there might be some encryption-related instruction support in the 24kc. I wouldn't expect this type of perf bump for "normal" workloads, but it's good to see.

tt wrote:

Ah! I thought those were the two WNDR model # variants, 3700v2 being the newer unit. :-)

That is also true. I have both...
And currently my v1 has been flashed with the 24kc optimized firmware, while v2 has the one day older firmware for generic mips32r2 without optimizations.

(Last edited by hnyman on 30 Aug 2012, 17:30)

Forgot about that, turned on for my builds too smile

I am getting the same problem with your builds as Arokh's.

When I plug my USB Drive into it, it will reboot and just hang. The power light will flash green and all the Lan lights are on (no WiFi). Network shows no connection and I cant even ping or connect to the router. If I unplug the drive everything is fine. The drive works just fine on a PC, and I have tried fromatting it to EXT4 to see if it was something to do with it being NTFS. Its only on the recent builds tho, as older ones it would boot fine with the drive plugged in (But I could never get it to appear on the network as a share though.). Even tried clearing all the firmware data as well..

Any ideas on what could be causing it? Am I missing something that I should have done?

Thanks

Cythrawl wrote:

Any ideas on what could be causing it? Am I missing something that I should have done?

Sorry, no idea.

I "updated" a couple of days ago to r33275 ... and suddenly none of my mail servers can be accessed from the WAN side, but only from the LAN side. All remote access is blocked.
What changed?

(Last edited by zzz2002 on 5 Sep 2012, 03:26)

zzz2002 wrote:

I "updated" a couple of days ago to r33275 ... and suddenly none of my mail servers can be accessed from the WAN side, but only from the LAN side. All remote access is blocked.
What changed?

Compared to the previous version a few days ago: nothing regarding firewall etc. has changed to my knowledge.
But I have no idea from which version you have updated from...
My build contains nothing special regarding firewall etc., so the possible change should be in the main Openwrt code.

-----

The official Attitude Adjustment 12.09 beta has been published. Seems to be based on revision 33312. My last build 33311 is equivalent to that, as the last check-in 33312 concerned another target platform than ar71xx.

(Last edited by hnyman on 5 Sep 2012, 06:26)