limiting bandwidth on laptop.

This commit is contained in:
Tom Alexander 2024-07-04 21:08:52 -04:00
parent b643f86313
commit 640d300adc
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 8 additions and 10 deletions

View File

@ -9,7 +9,7 @@ pf_config: "odofreebsd_pf.conf"
pflog_conf:
- name: 0
dev: pflog0
# dummynet_config: "dnctl.conf"
dummynet_config: "dnctl.conf"
network_rc: "odofreebsd_network.conf"
rc_conf: "odofreebsd_rc.conf"
loader_conf: "odofreebsd_loader.conf"

View File

@ -1 +1,2 @@
dnctl pipe 1 config bw 300KByte/s
dnctl pipe 1 config bw 100KByte/s
dnctl pipe 2 config

View File

@ -2,9 +2,10 @@ ext_if = "{ wlan0 }"
not_ext_if = "{ !wlan0 }"
jail_nat_v4 = "{ 10.215.1.0/24 }"
not_jail_nat_v4 = "{ any, !10.215.1.0/24 }"
rfc1918 = "{ 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 }"
dhcp = "{ bootpc, bootps }"
#allow = "{ wgf wgh drmario colo }"
allow = "{ wgf wgh drmario colo }"
tcp_pass_in = "{ 22 }"
udp_pass_in = "{ 53 51820 }"
@ -14,12 +15,6 @@ udp_pass_in = "{ 53 51820 }"
# options
set skip on lo
# queueing
# altq on wlan0 cbq queue { def, stuff }
# queue def cbq(default borrow)
# queue stuff bandwidth 8Mb cbq { dagger }
# queue dagger cbq(borrow)
# redirections
nat pass on $ext_if inet from $jail_nat_v4 to $not_jail_nat_v4 -> (wlan0)
rdr pass on $not_ext_if proto {tcp, udp} from any to 10.215.1.1 port 53 -> 172.16.0.1 port 53
@ -33,6 +28,8 @@ block log all
pass out on $ext_if
pass in on jail_nat
match in on jail_nat from any to any dnpipe 1
match in on jail_nat from any to $rfc1918 dnpipe 2
# Allow traffic from my machine to the jails/virtual machines
pass out on jail_nat from $jail_nat_v4
@ -41,7 +38,7 @@ pass out on jail_nat from $jail_nat_v4
# `service pf reload` but interfaces that we `skip` will not update (I
# forget if its from adding, removing, or both. TODO: test to figure
# it out). Also skipped interfaces are not subject to nat/rdr rules.
#pass quick on $allow
pass quick on $allow
pass on $ext_if proto icmp all
pass on $ext_if proto icmp6 all