From 3dd96dcc2c3a6b446290dd31214b202da84e6795 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 12 Nov 2022 15:11:15 -0500 Subject: [PATCH] Add forwarding for port 8081 to the jail. --- ansible/environments/home/hosts | 2 +- ansible/roles/firewall/files/homeserver_pf.conf | 7 +++++-- .../roles/sway/files/waybar_available_memory_freebsd.bash | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ansible/environments/home/hosts b/ansible/environments/home/hosts index 41c1e9e..0bf6393 100644 --- a/ansible/environments/home/hosts +++ b/ansible/environments/home/hosts @@ -1,2 +1,2 @@ [headless] -homeserver ansible_user=talexander ansible_host=192.168.1.215 +homeserver ansible_user=talexander ansible_host=192.168.1.123 diff --git a/ansible/roles/firewall/files/homeserver_pf.conf b/ansible/roles/firewall/files/homeserver_pf.conf index a188426..83ffeed 100644 --- a/ansible/roles/firewall/files/homeserver_pf.conf +++ b/ansible/roles/firewall/files/homeserver_pf.conf @@ -17,8 +17,11 @@ set skip on lo nat on $ext_if inet from $jail_net_v4 to { any, !$jail_net_v4 } tag ALLOWED -> (wlan0) nat on $ext_if inet from $full_nat_v4 to { any, !$full_nat_v4 } tag ALLOWED -> (wlan0) -rdr on host_uplink0 inet proto {tcp, udp} from any to 10.193.223.1 port 53 tag ALLOWED -> 1.1.1.1 port 53 -rdr on host_uplink1 inet proto {tcp, udp} from any to 10.213.177.1 port 53 tag ALLOWED -> 1.1.1.1 port 53 +rdr pass on host_uplink0 inet proto {tcp, udp} from any to 10.193.223.1 port 53 tag ALLOWED -> 1.1.1.1 port 53 +rdr pass on host_uplink1 inet proto {tcp, udp} from any to 10.213.177.1 port 53 tag ALLOWED -> 1.1.1.1 port 53 + +nat pass on host_uplink0 inet proto tcp from any to any port 8081 tag ALLOWED -> (host_uplink0) +rdr pass on $ext_if inet proto tcp from any to any port 8081 tag ALLOWED -> 10.193.223.20 port 8081 # filtering block log all diff --git a/ansible/roles/sway/files/waybar_available_memory_freebsd.bash b/ansible/roles/sway/files/waybar_available_memory_freebsd.bash index 0e46085..8041755 100644 --- a/ansible/roles/sway/files/waybar_available_memory_freebsd.bash +++ b/ansible/roles/sway/files/waybar_available_memory_freebsd.bash @@ -8,6 +8,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" SLEEP_INTERVAL=${SLEEP_INTERVAL:-30} while true; do + # TODO: Why not vm.stats.vm.v_page_size ? Are these the same? page_size=$(sysctl -n hw.pagesize) free_pages=$(sysctl -n vm.stats.vm.v_free_count) free_bytes=$((page_size * free_pages))