I currently have a FreeBSD 8.2 media server set up on my LAN that I use to stream my music from.
I also have an SSH login that I use to do file transfers to and from this server remotely. I would like to set up ALTQ (and have gotten this working) to limit my outgoing bandwidth from the server for SSH traffic. However, configuring ALTQ this way is also limiting my internal traffic (and thus interfering with my music streaming) since I am only using a single network interface.
Can anyone show me how I would use PF and ALTQ to limit outgoing WAN traffic while allowing all internal LAN traffic to go through unhindered?
ext_if="eth0"
int_if="eth0"
altq on eth0 cbq bandwidth 1Mb queue { std, ssh }
queue std bandwidth 80% cbq(default)
queue ssh bandwidth 20% cbq(ecn)
pass out on eth0 proto tcp to port 22 queue ssh
eth0 is my LAN interface, my total WAN bandwidth on my cable connection is 1Mb/s, and my internal network is 10/100.
Edit: perhaps it will be more clear if I illustrate my network:
I have four total machines on my network all hooked up to a standard wireless router (no dd-wrt or anything on it yet): 1) XBMC box that needs wifi access 2) Normal desktop PC running windows 3) Laptop that would like wireless access to the firewall 4) Fileserver running freebsd with 1 NIC that needs limiting.
The fileserver has one NIC. All I really need to do is limit the total outgoing bandwidth to the WAN on my fileserver to an arbitrary percentage of my total broadband connection without applying the same limits to LAN file transfers. To do this, I really need PF to be able to distinguish LAN-destined packets from WAN-destined packets.
Edit: This is what I've been working with lately but it doesn't seem to be properly putting stuff into the WAN queue:
my_net = 192.168.0.0/24
altq on eth0 cbq bandwidth 100Mb queue { wan, lan }
queue lan bandwidth 99500Kb cbq(default)
queue wan bandwidth 500Kb cbq(ecn)
pass out on eth0 from any to !$my_net queue lan