Home Blog Snippets About

All timestamps are based on your local time of:

Sep 20, 22:38:06 Sep 20, 23:08:06 Sep 20, 23:38:06 Sep 21, 00:08:06 Sep 21, 00:38:06 Sep 21, 01:08:06 Sep 21, 01:38:06 Sep 21, 02:08:06 Sep 21, 02:38:06 Sep 21, 03:08:06 Sep 21, 03:38:06 Sep 21, 04:08:06 Sep 21, 04:38:06 Sep 21, 05:08:06 Sep 21, 05:38:06 Sep 21, 06:08:06 Sep 21, 06:38:06 Sep 21, 07:08:06 Sep 21, 07:38:06 Sep 21, 08:08:06 Sep 21, 08:38:06 Sep 21, 09:08:06 Sep 21, 09:38:06 Sep 21, 10:08:06 Sep 21, 10:38:06 Sep 21, 11:08:06 Sep 21, 11:38:06 Sep 21, 12:08:06 Sep 21, 12:38:06 Sep 21, 13:08:06 Sep 21, 13:38:06 Sep 21, 14:08:06 Sep 21, 14:38:06 Sep 21, 15:08:06 Sep 21, 15:38:06 Sep 21, 16:08:06 Sep 21, 16:38:06 Sep 21, 17:08:06 Sep 21, 17:38:06 Sep 21, 18:08:06 Sep 21, 18:38:06 Sep 21, 19:08:06 Sep 21, 19:38:06 Sep 21, 20:08:06 Sep 21, 20:38:06 Sep 21, 21:08:06 Sep 21, 21:38:06 Sep 21, 22:08:06 Sep 21, 22:38:06



Posted by: stak

Tags: mozilla

Posted on: 2017-08-19 17:57:49 I previously wrote about setting up multiple VLANs to segment your home network and improve the security characteristics. Since then I've added more devices to my home network, and keeping everything in separate VLANs was looking like it would be a hassle. So instead I decided to put everything into the same VLAN but augment the router's firewall rules to continue restricting traffic between "trusted" and "untrusted" devices.



The problem is that didn't work. I set up all the firewall rules but for some reason they weren't being respected. After (too much) digging I finally discovered that you have to install the kmod-ebtables package to get this to actually work. Without it, the netfilter code in the kernel doesn't filter traffic between hosts on the same VLAN and so any rules you have for that get ignored. After installing kmod-ebtables my firewall rules started working. Yay!



Along the way I also discovered that OpenWRT is basically dead now (they haven't had a release in a long time) and the LEDE project is the new fork/successor project. So if you were using OpenWRT you should probably migrate. The migration was relatively painless for me, since the images are compatible. (Edited 06-Jan-2019: LEDE has merged back into OpenWRT since I wrote this)



There's one other complication that I've run into but haven't yet resolved. After upgrading to LEDE and installing kmod-ebtables , for some reason I couldn't connect between two FreeBSD machines on my network via external IP and port forwarding. The setup is like so:

Machine A has internal IP address 192.168.1.A

Machine B has internal IP address 192.168.1.B

The router's external IP address is E

The router is set to forward port P to machine A

The router is set to forward port Q to machine B Now, from machine B, if connect to E:P, it doesn't work. Likewise, from machine A, connecting to E:Q doesn't work. I can connect using the internal IP address (192.168.1.A:P or 192.168.1.B:Q) just fine; it's only the via the external IP that it doesn't work. All the other machines on my network can connect to E:P and E:Q fine as well. It's only machines A and B that can't talk to each other. The thing A and B have in common is they are running FreeBSD; the other machines I tried were Linux/OS X.



Obviously the next step here is to fire up tcpdump and see what's going on. Funny thing is, when I run tcpdump on my router, the problem goes away and the machines can connect to each other. So there's that. I'm sure with more investigation I'll get to the bottom of this but for now I've shelved it under "mysteries that I can work around easily". If anybody has run into this before I'd be interested in hearing about it.



Also if anybody knows of good tools to visualize and debug iptables rules I'd be interested to try them out, because I haven't found anything good yet. I've been using the counters in the tables to try and figure out which rules the packets are hitting but since I'm debugging this "live" there's a lot of noise from random devices and the counters are not as reliable as I'd like.