Posts

Traffic accounting

Got this from here: http://www.catonmat.net/blog/traffic-accounting-with-iptables/ All i'm interested in is my monthly bandwidth consumption, not the individual devices, there are plenty of forum threads/tools to do that. But why bring in additional tools when iptables has it all? iptables -N TRAFFIC_ACCT iptables -I FORWARD -j TRAFFIC_ACCT iptables -A TRAFFIC_ACCT and to just get the number: iptables -L TRAFFIC_ACCT -v | sed -n 3p | cut -d' ' -f2 to reset the counters /usr/sbin/iptables -L TRAFFIC_ACCT -Z the cron job to reset at the begining of the month, and a daily telegram msg 1 0 1 * * /usr/sbin/iptables -L TRAFFIC_ACCT -Z  0 8 * * * /usr/bin/curl -s -X POST https://api.telegram.org/<BOTID>/sendMessage -d chat_id=<CHATID> -d text="$(/usr/sbin/iptables -L TRAFFIC_ACCT -v | /bin/sed -n 3p | /usr/bin/cut -d' ' -f3)" >/dev/null 2>&1 (you'll need to opkg install ca-bundle for the https to work)

Fixing 5G on LEDE 17.01.1/2/3

Finally! I figured out how to get the 5Ghz to work on LEDE. 17.01.3 in  /lib/firmware/ath10k/ rename cal-pci-0000:01:00.0.bin  to  pre-cal-pci-0000:01:00.0.bin reload ath10k_pci and we're good to go!

upgrading to LEDE 17.01.1 - but without 5Ghz

Event though 15.05 has been running stable upgrading to 17.01 seems like a good idea. Going the lazy route and simply using luci to do the upgrade. (note: it's a good idea to keep a list of all the packages you installed, you'll have to add them all again) Since this is an upgrade from wrt we grab this file: https://downloads.lede-project.org/releases/17.01.0/targets/ar71xx/nand/lede-17.01.0-r3205-59508e3-ar71xx-nand-nbg6716-squashfs-sysupgrade.tar (yes it is a tar) under System->Flash/Back (make sure keep settings is checked) and.... somewhat success: system reboots, is accessible over ssh but luci isn't (but uhttpd is running). /etc/init.d/uhttpd restart seems to bring it back online. (with an enable). onward with restoring the missing packages: opkg update for ddns (settings were nicely maintained as expected) opkg install ddns-scripts luci-app-ddns for wake on LAN (i did have to recreate my wakenas script manually, and luci-app-wol doesn't show...

Guest/IoT WiFi with VLANs (multple APs)

Image
Time to revisit the Guest WiFi setup. I'm planning an additional AP for guests and IoT devices. So let's see if we can get VLANs setup... config switch_vlan         option device 'switch0'         option vlan '2'         option ports '5 6' This is confusing: ports 5 and 6 are setup as part of VLAN2 - but aren't used/connected ? (could be an internal connection for the wifi - but let's go boldly etc.) add a VLAN3 under switch config note: I have the CPUport AND port2 tagged. in both VLAN1 and the new VLAN3. I will be connecting my additional AP on port2. (/etc/config/network) config switch_vlan         option device 'switch0'         option vlan '3'         option vid '3'         option ports '0t 2t' then define a new interface 'guest' attach it to eth0.3 with STATIC IP  (/etc/config/network) config interface 'gues...

Ath10k alternative driver firmware - CC15.05.1 wireless unstable

I'm still experiencing trouble with the 5Ghz, maybe even WRT in general, up to the point I'm considering going back to the original Zyzel AA release. One last effort to see if this helps: I'm currently running an alternative driver firmware for the  QCA988X get it from github i'm running the last of the 4 series 10.2.4.48 (not sure if running the 5 series is possible, something for later) rename the file to firmware-4.bin and replace the one that's already there in /lib/firmware/ath10k/QCA988X/hw2.0 There's probably a way to force WRT to reload the driver, but hey I rebooted. First look seems fine, let's see if it's more stable. -- update -- leaving channel selection on 'auto' didn't work - 5G did not come up. (no mesgs as to why) manually selecting a channel did seem to work, at least when also selecting a 20Mhz bandwidth, 40Mhz seemed to work but I had some devices not connecting properly. -- update2 -- 5G was mostly s...

wpad - caching proxy part 2

proxy autoconfig is a combination of DHCP optons, and a bit of JS in a wpad.dat file. under  network>hostnames  add an entry ' wpad ' pointing to your router's lan-ip then create a /www/wpad.dat file (got mine from here ). and changed the default rule to point to polipo - 10.0.0.1:8123 also changed .local into .lan for lan hosts , and commented some stuff out that didn't seem relevant. function FindProxyForURL(url, host) { // If the hostname matches, send direct. //   if (dnsDomainIs(host, "intranet.domain.com") || //        shExpMatch(host, "(*.abcdomain.com|abcdomain.com)")) //        return "DIRECT"; // If the protocol or URL matches, send direct.     if (url.substring(0, 4)=="ftp:" ||         shExpMatch(url, "http://abcdomain.com/folder/*"))         return "DIRECT"; // If the requested website is hosted within the internal network, send direct. ...

Caching proxy w/ polipo (part1)

Let's see if we can (at least make it seem like) web browsing is faster... (i'm still not sure whether installing SQM was an improvement) I chose polipo as it is geared to home use and is supposedly easier to deal with than squid. And it comes with its own luci app so install is dead easy install luci-app-polipo defaults looked sensible, so I just directed my browser to use router.lan:8123 as proxy, and presto - things indeed 'feel' faster. A check with chrome didn't reveal a significant decrease in load time though - 11.9s vs 11, even on a reload... but in this case the log showed a lot of cache directives not being recognized by polipo. ! there might be an issue with the resolver and local hostnames (openwrt.lan) but not sure yet. Anyhoo, so let's add some storage for polipo to use so everything won't have to go in RAM. Apparently ext4 is the better filesystem for wrt so let's prepare a usb stick for that. (sudo) fdisk -l -> check wher...