Hello lovely people of OpenWrt!
I am trying to set up a separate network for my kids that uses OpenDNS, Adblocking and a whole bunch of other DNS based content filtering using this (KidSafe WiFi, Forced SafeSearch and Adblock) awesome guide. I have run into a bit of a snag though. The kid's network for some reason requires that my 'lan' network (the main or "adult" network) have masquerading turned on. I would like for the two networks to be independent of one another. The masquerading needs to be on anyways for my vpn to work, but this shouldn't have anything to with the kid's network.
Second, in the config files I set both networks to be bridges. I am assuming this is wrong as my main network loses DHCP for clients when the kid's net is a bridge. If I comment that line out, I get DHCP back. I am pretty certain it is because I have created vlans incorrectly. I am trying to fix this but I am having trouble understanding how the switch and vlan configurations work in the first place. Here is my network config:
config interface 'lan'
option type 'bridge'
option ifname 'eth0.1'
option proto 'static'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
option dns '1.1.1.1 1.0.0.1'
config interface 'wan'
option ifname 'eth1'
option proto 'dhcp'
option peerdns '0'
config interface 'wan6'
option ifname 'eth1'
option proto 'dhcpv6'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option ports '0 1 2 3 5'
option vid '1'
config switch_vlan
option device 'switch0'
option vlan '2'
option ports '4 6'
option vid '2'
config interface 'kidsvlan'
option type 'bridge'
option ifname 'eth0.2'
option proto 'static'
option netmask '255.255.255.0'
option dns '208.67.222.123 208.67.220.123'
option ipaddr '192.168.2.1'
And here is the switch configuration per the wiki:
I can't quite figure out how ports 4, 5 and 6 work. According to my network config file eth1 is my WAN/Internet, but the wiki has eth0 (which is what my 'lan' network uses) on the same line as the Internet...? This doesn't seem right to me but I'm definitely not an expert so I would greatly appreciate it if someone could help me understand this. Thanks!