"gateway of last resort" term: ChatGPT says it's the default gateway Seems like it's in good company there I've always associated the term with routers Alright, routing! We've added a bunch of default routes Now more routes! Demo setup today: My old piece of junk laptop (orcrist) running FreeBSD Another old piece of junk laptop running Linux with no wifi card IF it works! I can borrow a desktop in 310 if it doesn't Can we get the Linux laptop online using the wifi in this room? Piece of the puzzle #1: How are you going to see what I'm doing? First: The projector! Second: We can SSH into it so the screen share looks good Piece #2: Connecting them together with a little subnet We'll give each of them an address in 172.16 Can they communicate? (hopefully!) Piece #3: Putting ocrist online We'll do this as manually as possible! Automation hides the details wpa_supplicant to handle the WPA authentication Then we'll use dhclient to run DHCP Let's see what we ended up with for a routing table (netstat -r) Two ways we could go from here: Bridging: Just send traffic back and forth without change IP range NAT: Have a different IP range on each side of orcrist Piece #4: Using NAT We could set gateway_enable="YES" in rc.conf to turn this on all the time I don't want to Makes it easy to cause a weird problem sysctl net.inet.ip.forwarding needs to be set to 1 There's a /proc file in Linux that'll do the equivalent thing Setting a route to the little network isn't really needed in this case Because we're directly connected to 172.16 So we can talk to either the Internet or our other laptop! /etc/pf.conf and pfctl Run like this: pfctl -nvf /etc/pf.conf Take out "n" to have it actually add the route Good to verify first! A suggestion from the FreeBSD Handbook: ext_if = "xl0" # macro for external interface - use tun0 for PPPoE int_if = "xl1" # macro for internal interface localnet = $int_if:network # ext_if IP address could be dynamic, hence ($ext_if) nat on $ext_if from $localnet to any -> ($ext_if) block all pass from { lo0, $localnet } to any keep state Does it work? (who knows!) Piece #5: Not using NAT Bridging: Basically, we'll just pass traffic through in a transparent manner Our presence will be invisible! ifconfig bridge create ifconfig bridge0 ifconfig bridge0 addm wlan0 addm em0 up (and have both interfaces actually up) Bridge can have an IP address if we want it to Do we? Probably Will this work? I couldn't get it to work with wifi, but I'll try wired Couple other things we could do: Since the switch ports aren't set to trunk (probably), we can't play with vlans Could otherwise - Linux and FreeBSD are happy to play ball STP/RSTP: Linux and FreeBSD are again happy to play ball I doubt the switch wants to, certainly not the AP Alright, we've put orcrist into the middle in a couple configurations Let's run wireshark on ocrcist and spy on the other laptop! Could you use this in other ways? Sure! We could, for example, set up our own wifi network Just need another card