Build for Fritzbox 4040, switch and LUCI working

inspired by

and

I decided to build my own firmware, got me a 2nd FB4040 and here the fun started.

git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
git fetch --tags
git checkout v19.07.3
./scripts/feeds update -a && ./scripts/feeds install -a

modify target/linux/ipq40xx/base-files/etc/board.d/02_network (see forum for details)

copy the patch "715-net-essedma-disable-default-vlan.patch" --> target/linux/ipq40xx/patches-4.14

make menuconfig

make -j5 // as my cpu has 4 cores

flash the image and ...

My switch now has:
2 CPU ports
8 LAN ports and
1 WAN port

Reason:
I left a backup copy of "02_network" in the "target/linux/ipq40xx/base-files/etc/board.d/" directory
Hence the backup copy was build into the image and "ucidef_add_switch" was called twice.

Next try without the backup copy of "02_network"
Switch now looks as expected and adding a VLAN works.
Just added a guest network to LAN Port 1 --> working fine.

Will do some speed test and report.

Cheers,
Thomas

Thanks to @NoTengoBattery and @willowen100

1 Like

After enabling "Software flow offloading" my box easily reaches more than 400 MBits/sec (NAT)
Further testing with VLANs were successfull too.

Anybody willing to try this build ?

Links and SHA256 checksums:

openwrt-19.07.3-ipq40xx-generic-avm_fritzbox-4040-squashfs-eva.bin
https://drive.google.com/file/d/17eD3LE8uWHY082EvIGjG1ZopLBDlsqPY/view?usp=sharing
9DCBA8AB8383F0531DA379F5A8B900831BB4B0590EC51EB13B7C9B458F1A2824

openwrt-19.07.3-ipq40xx-generic-avm_fritzbox-4040-squashfs-sysupgrade.bin
https://drive.google.com/file/d/1rOo-HvH5onHuD86G_nyv0Pb-LfChg6xh/view?usp=sharing
1BB2ADA4799CFD4850B374731AFC5F39E7DA4A1AD7CD332DC857FDDAEB4D6497

Be aware that you MUST NOT keep settings as the LAN/WAN ports have changed.

LAN is now eth0.1 (was eth0)
WAN is now eth0.2 (was eth1)

Cheers,
Thomas

1 Like

Hi Thomas,

I received my 4040 this week but can't play with it now (I'm in familly holydays).
I will be back at home in few days and will be happy to make a try if that can help

Regards
Herve

Thanks a lot for this new build. I just installed it on my Fritzbox 4040 and it behaves as expected.
Congratulations!
Peter

Same thing here,
works very fine since few days :wink:

many thanks

Updated to version 19.07.5, links and SHA256 checksums:
openwrt-ipq40xx-generic-avm_fritzbox-4040-squashfs-eva.bin
https://drive.google.com/file/d/10SDETljw9lAO3oLVuSR63Wu6stYsLIk3/view?usp=sharing
DE947F3A0689D5E3E18E1F51D272B8C133A27B56E94FE5760AF42A8691C9250F

openwrt-ipq40xx-generic-avm_fritzbox-4040-squashfs-sysupgrade.bin
https://drive.google.com/file/d/1terW4RSluay40IFlHVMPNVv0xeaKiiwK/view?usp=sharing
E923B0710B5D36CAF202E034F7D3F170313076F9E8CCA67E2FBFF0EB62A55BDB

Updated to version 19.07.6, links and SHA256 checksums:

openwrt-19.07.6-ipq40xx-generic-avm_fritzbox-4040-squashfs-eva.bin
https://drive.google.com/file/d/16rU9ecqrlQ1MIbnmSCc2YqVAeFuU-EOF/view?usp=sharing
f04d5225d1fa4705d5fea8bc09f3a464a05a60b3800ecf02af977f475cc86ff1

openwrt-19.07.6-ipq40xx-generic-avm_fritzbox-4040-squashfs-sysupgrade.bin
https://drive.google.com/file/d/1Mdot0tcye46hh98wrDyr6ZnedW8bd0qb/view?usp=sharing
608c1d8372aa131ae92ee4d3bab01e5ec5eaed8662d31a7b293c8fd470231e8c

Due to VLAN problems in my FB4040 described in

I tried @tomtom 's image which is working great!!!
Thank you very much!

I'm currently (probably like many of you) working from home.
When I saw this afternoon that there was a new release of Openwrt
i started my build system and here's the result:

Links and SHA256 sums

openwrt-19.07.7-ipq40xx-generic-avm_fritzbox-4040-squashfs-eva.bin
https://drive.google.com/file/d/1VGsd5lJjq5w_uWo2Hnedq0EEnIr-iUgE/view?usp=sharing
079d68ca5613b987fe2f9bf0907eac57d459efba3db070e9823531ffc248e9c4

openwrt-19.07.7-ipq40xx-generic-avm_fritzbox-4040-squashfs-sysupgrade.bin
https://drive.google.com/file/d/1YkKvOD9TZuapoUFPHqA4gIjqHYIXnpSs/view?usp=sharing
280fcf597b91f5fca5e0461162c059c03ea070dfd45282c944d491eb41cac414

One more hint:
add "echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor"
to /etc/rc rc.local (or System -> Startup -> Local Startup)

To see the difference to a "ping localhost" before and after.

Cheers,
Thomas

1 Like

Goodnight,
and updated my Openwrt (FritzBox 4040), to version 19.07.7 and tested the Local Startup recommendation.
Now I get much better data when measuring my Download and Upload. I've been testing all afternoon and so far I'm very happy that I have better data when measuring my bandwidth

I found an issue in my 19.07.6 build.
The opkg repository is pointing to http://downloads.openwrt.org/releases/19.07.3/...
To fix this, change the opkg config to point to http://downloads.openwrt.org/releases/19.07.6/...
Or update to 19.07.7

Cheers,
Thomas

Hello Thomas,
I would love to try your built. I am hesitant though because of these changes. I am having
WAN eth1.7 (has to be tagged vlan7 as a requirement of the ISP)
LAN eth0
FON eth0.4 (to speparate IP telephones)

If I were installing your built, what would the names of my interfaces be?

How did you test this? Is it not a matter of your contracted internet speed (mine is a 50 MBits/s line and performs usually sligthly better on dslreports.com/speedtest)?

Cheers
Oscar

Would you mind to share the result of an iperf3 test for both 2,4 and 5 GHz wifi for reference? Mine is around 80 MBits/s for 2,4 GHz and ~ 350 MBits/s for the 5 GHz wireless connection (direct measurement between laptop and router). Would normally be entirely sufficient for me, but the connection is sometimes moody, with dropouts of the connection up to a minute or so. Hence the question.

Cheers
Oscar

Hi Oscar,
as mentioned before, the default config oy my build is:
LAN = eth0.1
WAN = eth0.2 (untagged) you would change that to VLAN 7, tagged on the WAN port.
FON would be eth0.4, you could add that VLAN in the Gui.

I was using the speedtest of my cable ISP, which does test the speed
to the cable modem and afterwards the speed to the router.
In both cases it was above 400 MBits/sec.

Cheers,
Thomas

Hi Oscar,
i have very similar iperf3 results in both (2,5 and 5 GHz) frequence ranges, measured from my notebook against a debian box connected via cable to the lan port of the router.

Cheets,
Thomas

Hi Thomas,

I have used your build openwrt-19.07.7-ipq40xx-generic-avm_fritzbox-4040-squashfs-eva.bin
and made the echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor into
System -> Startup -> Local Startup

I have now 4 VLAN's including the WAN Port!

Thank you very much it is working fine. :wink:

ChriWo

Hi Wolfgang,
here is my preferred way:

wget "https://downloads.openwrt.org/releases/19.07.7/targets/ipq40xx/generic/config.buildinfo"
copy/move to .config
make menuconfig
Target Profile, change from "Multiple devices" to "AVM Fritz!Box 4040"
Deselect "Build the OpenWrt Image Builder"
Deselect "Build the OpenWrt SDK"
Save & done

Short but important hint, snippet from my openwrt-19.07.7/target/linux/ipq40xx/base-files/etc/board.d/02_network

avm,fritzbox-4040|\
linksys,ea6350v3|\
linksys,ea8300)
	ucidef_set_interfaces_lan_wan "eth0.1" "eth0.2"
	ucidef_add_switch "switch0" \
		"0t@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
	;;

Software flow offloading can be found in Network --> Firewall

Cheers,
Thomas

Thanks Thomas, I will try :wink:

Found an issue when trying to install a "kmod"-package from the official repository , looks like my .config was too different.
New start from "https://downloads.openwrt.org/releases/19.07.7/targets/ipq40xx/generic/config.buildinfo", make, wait, sysupgrade and issue is gone.
New build and SHA256 sums are here:

openwrt-19.07.7-ipq40xx-generic-avm_fritzbox-4040-squashfs-eva.bin
https://drive.google.com/file/d/19t3dMOuvQ34ehMuXRMtj8zEgdWV4zCXF/view?usp=sharing
17CDFF74E2A1C1215E0E96EFE5BC8526640FA6D5108EBBB1A19F93E0F77B9C2C

openwrt-19.07.7-ipq40xx-generic-avm_fritzbox-4040-squashfs-sysupgrade.bin
https://drive.google.com/file/d/1AXEBYrjTfEWav7uWvk6tHKXy3TGFyK2m/view?usp=sharing
3D77B5BA46033A12E197A0F1265561419924331DF04E80CC7296B0F0EABEE890

Cheers,
Thomas

1 Like