I originally migrated my ruleset from pf (FreeBSD) and I suppose the shortcut I did to make it work also let everything pass:
#iifname vmap {
# veth: accept,
# lan: accept,
# "bridge": accept
#}
I noticed in my rules that I specified oifname wan everywhere, so subsequent rules were not working because I only allowed traffic out through the wan, but not any of the intermediate interfaces. So, I think I sorted that out, but the only thing that remains appears to be the chromecast and Vizio TV.
This is my forward chain:
Code: Select all
chain forward {
type filter hook forward priority 0; policy drop;
ct state vmap { established : accept, related : accept, invalid : drop }
# without this, it seems the router itself cannot get to the Internet (via curl), ping still works
# correction, the router was unable to get to the Internet with this
#iifname vmap {
# veth: accept,
# lan: accept,
# "bridge": accept
#}
include "forward/communication/wechat.nft"
include "forward/communication/google-voice.nft"
include "forward/communication/whats-app.nft"
include "forward/communication/apple-facetime.nft"
include "forward/communication/gmail.nft"
include "forward/web.nft"
include "forward/westinghouse-vpn.nft"
include "forward/whois.nft"
include "forward/gaming/steam.nft"
include "forward/gaming/fortnite.nft"
include "forward/gaming/roblox.nft"
include "forward/development/keyservers.nft"
include "forward/development/vscode.nft"
include "forward/development/github.nft"
include "forward/amazon-echo.nft"
include "forward/google-home.nft"
include "forward/android-play-store.nft"
include "forward/library-clients.nft"
# Internet access is not required and may only be needed for the initial setup
include "forward/tp-link-switch.nft"
###include "forward/ayi-robot-mower.nft"
include "forward/gentoo-rsync.nft"
log prefix "forward.dropped:"
}
chain postrouting {
type nat hook postrouting priority 100; policy accept;
ip saddr $LOCAL_NETWORK_CIDR oifname wan masquerade
}
chain prerouting {
type nat hook prerouting priority 0;
# ip daddr 8.8.8.8 tcp dport domain dnat to 192.168.72.1:53
# ip daddr 8.8.8.8 udp dport domain dnat to 192.168.72.1:53
ip daddr 0.0.0.0/0 tcp dport domain dnat to 192.168.72.1:53
ip daddr 0.0.0.0/0 udp dport domain dnat to 192.168.72.1:53
ip daddr 0.0.0.0/0 udp dport ntp dnat to 192.168.72.100:123
}Code: Select all
define CHROMECAST_OUTBOUND_TCP_PORTS = { http, https, 5228 }
define GOOGLE_DNS_SERVERS = { 8.8.8.8, 8.8.4.4 }
ip saddr @group_chromecast ip daddr $GOOGLE_CIDR icmp accept
ip saddr @group_chromecast ip daddr $GOOGLE_CIDR tcp dport $CHROMECAST_OUTBOUND_TCP_PORTS accept
# PBS kids
ip saddr @group_chromecast ip daddr $GOOGLE_DNS_SERVERS icmp accept
ip saddr @group_chromecast ip daddr $GOOGLE_DNS_SERVERS tcp dport domain accept
ip saddr @group_chromecast ip daddr $GOOGLE_DNS_SERVERS udp dport domain accept
# Vizio
#ip saddr @group_chromecast ip daddr @dynamic_network_ntp_servers udp dport ntp accept
ip saddr @group_chromecast udp dport ntp accept
Code: Select all
ip saddr @group_web_client tcp dport { http, https } accept
ip saddr @group_web_client udp dport { http, https } accept
I am using tcpdump and writing that to a file and then using wireshark to make it easier to follow streams. My best estimate is that it is thinking it is not connected because it appears NTP traffic is not being answered by my NTP server running locally.
I should also note that for the Vizio, a significant part of the problem is that it seems reluctant to perform a DHCPREQUEST.


