|
Skip to main contentAccessibility help
|
|
AI Mode
|
|
All
|
|
Videos
|
|
Forums
|
|
Short videos
|
|
More
|
|
Upgrade
|
|
|
|
|
|
I have set inbound and outbound rules in windows 11 firewall and still I do not get the ssh prompt from remote subnet freebsd server
|
|
I know how frustrating it is to configure firewall rules and still hit a wall. Windows Defender Firewall is almost certainly not the reason your SSH connection to the FreeBSD server is failing.
|
|
By default, Windows 11 allows all outbound connections, meaning you didn't need to create an outbound rule for an SSH client in the first place. Because you are connecting to a remote subnet, the block is happening further down the line—either at the network routing level or on the FreeBSD server itself.
|
|
Run through these checks in order to find where the packets are being dropped:
|
|
1. Test TCP Port 22 from Windows
|
|
Open PowerShell on your Windows 11 machine and run:
|
|
powershell
|
|
Test-NetConnection -ComputerName <FreeBSD_IP> -Port 22
|
|
Use code with caution.
|
|
If TcpTestSucceeded is False: The traffic is being blocked before it reaches the SSH daemon, or routing between subnets is broken.
|
|
If TcpTestSucceeded is True: The network path is fine, and your SSH client or the FreeBSD server configuration is hanging during authentication.
|
|
2. Check Inter-Subnet Routing & Gateway Firewalls
|
|
Since the FreeBSD box is on a remote subnet, traffic has to pass through at least one router or firewall (e.g., pfSense, OPNsense, UniFi, or a corporate VPN).
|
|
Router Firewall: Many routers block traffic between different VLANs/subnets by default unless an explicit "Allow" rule is added on the router itself.
|
|
Asymmetric Routing / Missing Route: Does the FreeBSD server know how to route traffic back to your Windows 11 subnet? Run netstat -rn on the FreeBSD box to ensure its default gateway or static routes cover your Windows subnet.
|
|
3. Check FreeBSD's Local Firewall (pf or ipfw)
|
|
FreeBSD firewalls often restrict incoming SSH (port 22) to the local subnet only. On the FreeBSD server, check if a firewall is active:
|
|
For PF: Run pfctl -sr to view active rules. Look for rules restricting port 22 or ssh to a specific interface or local subnet.
|
|
For IPFW: Run ipfw list to check for deny rules affecting your Windows subnet.
|
|
4. Verify sshd is Listening on All Interfaces
|
|
On the FreeBSD server, ensure the SSH daemon isn't bound only to localhost or a single IP. Run:
|
|
sh
|
|
sockstat -4 -l | grep :22
|
|
Use code with caution.
|
|
You should see *:22 or the specific IP address you are trying to reach. If it only says 127.0.0.1:22, edit /etc/ssh/sshd_config, set ListenAddress 0.0.0.0, and run service sshd restart.
|
|
5. Run SSH in Verbose Mode
|
|
If the port is open (TcpTestSucceeded : True) and you still don't get a prompt, run SSH with verbose output in PowerShell to see the exact line where it stalls:
|
|
powershell
|
|
ssh -vvv user@<FreeBSD_IP>
|
|
Use code with caution.
|
|
If you share:
|
|
The output of Test-NetConnection or ssh -vvv
|
|
How the two subnets are connected (VLANs, site-to-site VPN, or standard router)
|
|
I can help pinpoint the exact bottleneck.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
It is the reason. If i switch off windows 11 firewall i get the login prompt
|
|
Fair enough—if turning off the Windows Firewall immediately gives you the prompt, then Windows Firewall is definitely the culprit.
|
|
When you have custom rules in place and it still blocks traffic until you turn the whole thing off, it almost always comes down to one of four specific Windows Firewall quirks:
|
|
1. A Hidden "Block" Rule is Overriding Your "Allow" Rule
|
|
In Windows Defender Firewall, explicit Block rules always beat Allow rules, no matter what order they are in.
|
|
Open Windows Defender Firewall with Advanced Security (wf.msc).
|
|
Check both Inbound Rules and Outbound Rules, sort by Action, and look for any Block rules targeting ssh.exe, TCP Port 22, or your remote subnet.
|
|
Also check if your Outbound default action was changed from Allow to Block (right-click the top-level Windows Defender Firewall with Advanced Security node -> Properties -> check the Public, Private, and Domain tabs).
|
|
2. Network Profile Mismatch (Public vs. Private)
|
|
Windows assigns your network adapter a profile (Public, Private, or Domain).
|
|
If your network is currently set to Public (which Windows loves to do on custom/routed networks), any rule you created that only applies to the Private profile will be completely ignored.
|
|
Check your rules in wf.msc -> double-click your rule -> Advanced tab -> make sure Domain, Private, and Public are all checked.
|
|
3. Remote IP Scope Restriction on Default Rules
|
|
If you modified an existing rule or created one with a scope, check the Scope tab of your rule in wf.msc:
|
|
Under Remote IP address, Windows often defaults to Local subnet for certain built-in rules.
|
|
Since your FreeBSD server is on a remote subnet, Windows will drop the return packets if the rule is scoped to "Local subnet" instead of Any IP address (or your specific FreeBSD subnet).
|
|
4. You Targeted the Wrong ssh.exe Binary
|
|
Windows 11 often has multiple SSH clients installed (e.g., C:\Windows\System32\OpenSSH\ssh.exe, Git Bash's ssh.exe, WSL, or PuTTY).
|
|
If your rule specifies a Program path, make sure it matches the exact executable you are running.
|
|
To rule out program-path issues, set the rule's Programs and Services tab to All programs that meet the specified conditions, and filter strictly by Protocol: TCP and Remote Port: 22 on the Outbound rule.
|
|
Quickest Way to Confirm What's Dropping It
|
|
Turn the firewall back on, open PowerShell as Administrator, and run this to log dropped packets:
|
|
powershell
|
|
netsh advfirewall set allprofiles logging droppedconnections enable
|
|
Use code with caution.
|
|
Try to SSH again, then check the log file at C:\Windows\System32\LogFiles\Firewall\pfirewall.log to see the exact DROP entry and which IP/port triggered it. (Run netsh advfirewall set allprofiles logging droppedconnections disable when done).
|
|
If you'd like, share:
|
|
A screenshot of your rule's properties (Scope and Advanced tabs) in wf.msc
|
|
The DROP line from pfirewall.log
|
|
I can tell you the exact setting to flip.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
there are no block actions
|
|
If there are no explicit Block rules, then Windows Firewall is either ignoring your Allow rule due to a scope/profile mismatch, or your Outbound default policy is set to Block while your Allow rule isn't matching the outbound packet.
|
|
Run these two checks in an Administrator PowerShell window to expose the exact mismatch immediately:
|
|
1. Check Your Active Profile & Default Outbound Behavior
|
|
Run this command to see what Windows actually thinks your network is doing right now:
|
|
powershell
|
|
Get-NetFirewallProfile | Select-Object Name, Enabled, DefaultInboundAction, DefaultOutboundAction
|
|
Use code with caution.
|
|
Look at DefaultOutboundAction. If it is set to Block (instead of Allow), Windows drops everything unless an Outbound Allow rule matches 100% of the packet's attributes.
|
|
2. Force-Create a Clean, Broad Outbound Allow Rule
|
|
To bypass any subtle misconfiguration in your existing rule (like wrong protocol direction, local port instead of remote port, or wrong profile), run this single command in Admin PowerShell:
|
|
powershell
|
|
New-NetFirewallRule -DisplayName "Allow SSH Outbound Test" -Direction Outbound -Protocol TCP -RemotePort 22 -Action Allow -Profile Any
|
|
Use code with caution.
|
|
(Note: You do not need an Inbound rule for an outgoing SSH connection—Windows Firewall is stateful and automatically allows return traffic for an established outbound connection).
|
|
Try your ssh command right after running that.
|
|
If it works: Your previous rule had a subtle mismatch—most commonly putting 22 in Local Port instead of Remote Port, selecting the wrong Network Profile (Public vs. Private), or locking it to a specific program path/interface.
|
|
If it STILL fails: Windows is dropping it via a Windows Filtering Platform (WFP) rule (such as an IPsec connection security rule or a third-party VPN/antivirus hook that hooks into the Windows Firewall service).
|
|
If that test rule doesn't immediately give you the login prompt, share:
|
|
The output of Get-NetFirewallProfile
|
|
Whether you are using a VPN client or third-party security suite
|
|
I can help you trace the exact WFP filter blocking it.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
>> Get-NetFirewallProfile | Select-Object Name, Enabled, DefaultInboundAction, DefaultOutboundAction
|
|
|
|
Name Enabled DefaultInboundAction DefaultOutboundAction
|
|
---- ------- -------------------- ---------------------
|
|
Domain True Block Allow
|
|
Private True Block Allow
|
|
Public True Block Allow
|
|
|
|
|
|
PS C:\WINDOWS\system32>
|
|
That proves Windows is NOT blocking your outbound SSH request—DefaultOutboundAction is set to Allow across all profiles, and you already confirmed there are no explicit Block rules.
|
|
Because turning the firewall off does let the prompt appear, Windows Firewall is dropping the return packets coming back from the FreeBSD server (DefaultInboundAction: Block).
|
|
Normally, Windows Firewall is stateful and automatically allows return packets for an outbound connection—unless asymmetric routing is breaking Windows' stateful tracking.
|
|
Why This Happens on Remote Subnets (Asymmetric Routing)
|
|
Your Windows 11 PC sends the initial SSH SYN packet out Interface A (e.g., Ethernet or Wi-Fi). Windows records the state on Interface A.
|
|
Because the FreeBSD server is on a remote subnet, the return SYN-ACK packet comes back through a router/VPN and hits Interface B on your Windows PC (e.g., a second NIC, Hyper-V virtual switch, WSL adapter, or VPN tunnel), OR Windows receives the return packet with a different source IP than the one it sent to (NAT hairpinning).
|
|
Windows sees an unsolicited SYN-ACK arriving on an unexpected interface/IP, doesn't match it to the outbound state, and drops it via DefaultInboundAction: Block.
|
|
When you turn the firewall off, DefaultInboundAction stops dropping that mismatched return packet, and the SSH prompt immediately appears.
|
|
How to Confirm & Fix It
|
|
Step 1: Log the Exact Dropped Return Packet
|
|
Run this in your Admin PowerShell window:
|
|
powershell
|
|
netsh advfirewall set allprofiles logging droppedconnections enable
|
|
Use code with caution.
|
|
Try ssh user@<FreeBSD_IP> once, then read the last few lines of the log:
|
|
powershell
|
|
Get-Content C:\Windows\System32\LogFiles\Firewall\pfirewall.log -Tail 15
|
|
Use code with caution.
|
|
Look for DROP TCP involving your FreeBSD server's IP. It will show you the exact Source IP, Destination IP, and Ports of the packet Windows is rejecting. (Turn logging off afterward with netsh advfirewall set allprofiles logging droppedconnections disable).
|
|
Step 2: Check Your Windows Routing Table & Adapters
|
|
Run this in PowerShell to see if you have multiple active routes or virtual adapters (Docker, Hyper-V, WSL, VPN) competing for that remote subnet:
|
|
powershell
|
|
Get-NetRoute -DestinationPrefix 0.0.0.0/0
|
|
Get-NetIPConfiguration | Select-Object InterfaceAlias, IPv4Address, IPv4DefaultGateway
|
|
Use code with caution.
|
|
If your outbound traffic goes out one adapter/IP and the return traffic enters another (or if you have a VPN/Hyper-V switch intercepting routes), fixing the route metric (Set-NetIPInterface -InterfaceAlias "<AdapterName>" -InterfaceMetric 10) so both directions use the same interface will restore stateful tracking and let SSH connect without weakening your firewall.
|
|
If you paste:
|
|
The DROP TCP line from pfirewall.log
|
|
Your Get-NetIPConfiguration output
|
|
I can show you the exact route or rule needed to fix it cleanly.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
PS C:\WINDOWS\system32> Get-Content C:\Windows\System32\LogFiles\Firewall\pfirewall.log -Tail 15
|
|
2026-11-29 09:56:30 DROP ICMP 192.168.1.254 192.168.1.92 - - 96 - - - - 5 1 - RECEIVE 4
|
|
2026-11-29 09:56:30 DROP ICMP 192.168.1.254 192.168.1.92 - - 96 - - - - 5 1 - RECEIVE 4
|
|
2026-11-29 09:56:31 DROP ICMP 192.168.1.254 192.168.1.92 - - 80 - - - - 5 1 - RECEIVE 4
|
|
2026-11-29 09:56:32 DROP ICMP 192.168.1.254 192.168.1.92 - - 96 - - - - 5 1 - RECEIVE 4
|
|
2026-11-29 09:56:33 DROP ICMP 192.168.1.254 192.168.1.92 - - 80 - - - - 5 1 - RECEIVE 4
|
|
2026-11-29 09:56:35 DROP ICMP 192.168.1.254 192.168.1.92 - - 96 - - - - 5 1 - RECEIVE 4
|
|
2026-11-29 09:56:37 DROP ICMP 192.168.1.254 192.168.1.92 - - 80 - - - - 5 1 - RECEIVE 4
|
|
2026-11-29 09:56:49 DROP ICMP 192.168.1.254 192.168.1.92 - - 68 - - - - 5 1 - RECEIVE 4
|
|
2026-11-29 09:58:02 DROP ICMP 192.168.1.254 192.168.1.92 - - 101 - - - - 5 1 - RECEIVE 4
|
|
2026-11-29 09:58:03 DROP ICMP 192.168.1.254 192.168.1.92 - - 101 - - - - 5 1 - RECEIVE 4
|
|
2026-11-29 09:58:03 DROP ICMP 192.168.1.254 192.168.1.92 - - 80 - - - - 5 1 - RECEIVE 4
|
|
2026-11-29 09:58:04 DROP ICMP 192.168.1.254 192.168.1.92 - - 101 - - - - 5 1 - RECEIVE 4
|
|
2026-11-29 09:58:05 DROP ICMP 192.168.1.254 192.168.1.92 - - 80 - - - - 5 1 - RECEIVE 4
|
|
2026-11-29 09:58:07 DROP ICMP 192.168.1.254 192.168.1.92 - - 101 - - - - 5 1 - RECEIVE 4
|
|
2026-11-29 09:58:10 DROP ICMP 192.168.1.254 192.168.1.92 - - 80 - - - - 5 1 - RECEIVE 4
|
|
PS C:\WINDOWS\system32>
|
|
Bingo. Look at that log line:
|
|
DROP ICMP 192.168.1.254 192.168.1.92 - - 96 - - - - 5 1 - RECEIVE 4
|
|
That is ICMP Type 5, Code 1 (ICMP Redirect for Host) from your gateway (192.168.1.254) to your Windows PC (192.168.1.92), and Windows Firewall is dropping it.
|
|
What is Actually Happening
|
|
Your Windows PC (192.168.1.92) doesn't have a specific route to the FreeBSD subnet, so it sends the SSH packet to your default gateway (192.168.1.254).
|
|
192.168.1.254 sees that the FreeBSD subnet actually lives behind another router on your 192.168.1.0/24 LAN, so it sends an ICMP Type 5 Code 1 (Redirect) packet back to Windows saying: "Don't send this to me, send it directly to the other router's IP."
|
|
Windows Firewall blocks ICMP Type 5 (Redirect) by default as a security measure (since spoofed redirects can hijack traffic).
|
|
Because Windows drops the ICMP Redirect, it keeps sending SSH packets to 192.168.1.254, which keeps rejecting/redirecting them instead of forwarding them—so the SSH connection never completes!
|
|
When you turn off Windows Firewall, Windows accepts the ICMP Redirect, updates its host route cache, and connects to FreeBSD immediately.
|
|
How to Fix It Properly (Without Leaving Your Firewall Off)
|
|
You have two clean ways to fix this permanently:
|
|
Option 1: Add a Static Route on Windows (Recommended & Most Secure)
|
|
Instead of allowing ICMP Redirects (which are disabled by default for security), add a permanent static route telling Windows which router handles the FreeBSD subnet:
|
|
powershell
|
|
route -p add <FreeBSD_Subnet> mask <Subnet_Mask> <Next_Hop_Router_IP>
|
|
Use code with caution.
|
|
(For example, if FreeBSD is on 192.168.2.0/24 via router 192.168.1.1: route -p add 192.168.2.0 mask 255.255.255.0 192.168.1.1)
|
|
Option 2: Allow ICMP Type 5 (Redirect) Specifically from Your Gateway
|
|
If you prefer to let your gateway (192.168.1.254) handle redirects dynamically, create a tightly scoped Inbound rule that allows ICMPv4 Type 5 only from 192.168.1.254:
|
|
powershell
|
|
New-NetFirewallRule -DisplayName "Allow ICMP Redirect from Gateway" -Direction Inbound -Protocol ICMPv4 -IcmpType 5 -RemoteAddress 192.168.1.254 -Action Allow -Profile Any
|
|
Use code with caution.
|
|
(Don't forget to disable firewall logging when you're done: netsh advfirewall set allprofiles logging droppedconnections disable).
|
|
If you tell me the FreeBSD subnet and the IP of the secondary router, I can give you the exact route -p add command to copy and paste.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
subnet is 192.168.20.0. router ip for that subnet is 192.168.20.254
|
|
Your Windows PC (192.168.1.92) cannot reach 192.168.20.254 directly as a next hop because it is on a different subnet—you must use the 192.168.1.x IP address of the router that bridges 192.168.1.0/24 and 192.168.20.0/24.
|
|
Because 192.168.1.254 is sending the ICMP Redirect, that secondary router has an interface on your local 192.168.1.0/24 network (for example, 192.168.1.1 or 192.168.1.253).
|
|
Step 1: Allow ICMP Redirect Temporarily to Reveal the Exact Router IP
|
|
Run this command in Admin PowerShell so Windows accepts the redirect from 192.168.1.254 once:
|
|
powershell
|
|
New-NetFirewallRule -DisplayName "Allow ICMP Redirect from Gateway" -Direction Inbound -Protocol ICMPv4 -IcmpType 5 -RemoteAddress 192.168.1.254 -Action Allow -Profile Any
|
|
Use code with caution.
|
|
Now run your ssh command once (it should give you the prompt immediately), then check Windows' routing table to see the exact 192.168.1.x gateway IP Windows learned:
|
|
powershell
|
|
route print 192.168.20.*
|
|
Use code with caution.
|
|
Step 2: Lock In the Permanent Static Route (and Remove the ICMP Rule)
|
|
Once route print 192.168.20.* shows you the Gateway IP (let's call it <Router_192.168.1.X>), run:
|
|
powershell
|
|
route -p add 192.168.20.0 mask 255.255.255.0 <Router_192.168.1.X>
|
|
Use code with caution.
|
|
(Optional) If you want to lock your firewall back down so it doesn't accept ICMP redirects anymore, remove the temporary rule:
|
|
powershell
|
|
Remove-NetFirewallRule -DisplayName "Allow ICMP Redirect from Gateway"
|
|
Use code with caution.
|
|
Your SSH connection to 192.168.20.0/24 will now work permanently with the Windows Firewall fully enabled—and you can also delete those extra inbound/outbound SSH rules you created earlier, since default outbound rules already allow SSH.
|
|
(Remember to turn off firewall logging too: netsh advfirewall set allprofiles logging droppedconnections disable)
|
|
If you run route print 192.168.20.* and want to double-check the output, share it here and I'll verify the exact permanent command for you.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
I have already added a route in router 192.168.1.254 to 192.168.20.0 via 192.168.1.90
|
|
That explains the whole loop! Your secondary router is 192.168.1.90.
|
|
When your Windows PC (192.168.1.92) sends packets to 192.168.1.254 (your main router), 192.168.1.254 looks at the static route you added (via 192.168.1.90), realizes both your PC and 192.168.1.90 are on the exact same 192.168.1.0/24 LAN, and tells Windows via ICMP Redirect: "Go straight to 192.168.1.90 instead of bouncing off me."
|
|
Because Windows Firewall blocks ICMP Redirects, Windows never learned about 192.168.1.90.
|
|
The Exact Command to Fix It Permanently
|
|
Run this in your Administrator PowerShell window:
|
|
powershell
|
|
route -p add 192.168.20.0 mask 255.255.255.0 192.168.1.90
|
|
Use code with caution.
|
|
Why This Solves Everything Cleanly
|
|
Bypasses the double-hop: Windows sends packets for 192.168.20.0/24 directly to 192.168.1.90 on the first try.
|
|
No ICMP Redirects triggered: 192.168.1.254 is never bothered, so it stops sending ICMP Type 5 packets that Windows Firewall drops.
|
|
Keeps Windows Firewall strict: You don't have to weaken your firewall by allowing ICMP Redirects or leaving custom port 22 rules open.
|
|
(Don't forget to turn off the firewall drop logging we enabled earlier: netsh advfirewall set allprofiles logging droppedconnections disable)
|
|
If you run that route -p add command, test your ssh connection—and let me know if you want to push this route automatically via DHCP so other Windows machines on your network don't hit the same issue.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
I should not have to add this route to every ohter pc on the network that is the whole point of adding routes to the router
|
|
You are 100% right—adding static routes to every single PC defeats the entire purpose of having a router.
|
|
The reason this happened comes down to a classic networking gotcha called Asymmetric Routing on a flat LAN, combined with Windows Firewall's stateful packet inspection:
|
|
Outbound (PC -> FreeBSD): Your PC sends the SYN packet to 192.168.1.254 (Default Gateway). 192.168.1.254 forwards it to 192.168.1.90 (Secondary Router), which delivers it to FreeBSD (192.168.20.x).
|
|
Return (FreeBSD -> PC): FreeBSD replies via 192.168.1.90. Because 192.168.1.90 sits directly on the 192.168.1.0/24 subnet, it delivers the SYN-ACK directly to your PC (192.168.1.92) without passing back through 192.168.1.254.
|
|
Why it breaks: Even if 192.168.1.254 forwards the outbound packet (while also sending an ICMP redirect that Windows drops), stateful firewalls (either on 192.168.1.254 or Windows) hate seeing outbound traffic go through 192.168.1.254 while return traffic comes directly from 192.168.1.90 (different Layer-2 MAC addresses).
|
|
3 Ways to Fix This Network-Wide (Zero PC Configuration)
|
|
1. Push the Route Automatically via DHCP (Option 121) — Cleanest & Best Practice
|
|
On your DHCP server (likely 192.168.1.254), configure DHCP Option 121 (Classless Static Routes) to hand out 192.168.20.0/24 -> 192.168.1.90 alongside the default gateway (0.0.0.0/0 -> 192.168.1.254).
|
|
Every Windows, Linux, and macOS device on your network will automatically receive the route when it gets an IP address—zero manual configuration on any client.
|
|
2. Put the Link Between 192.168.1.254 and 192.168.1.90 on a Separate Transit Subnet / VLAN
|
|
If your main router (192.168.1.254) supports VLANs or multiple LAN ports:
|
|
Put the secondary router (192.168.1.90) on its own dedicated transit subnet (e.g., 10.0.0.0/30).
|
|
Because the secondary router is no longer on 192.168.1.0/24, all traffic to and from 192.168.20.0/24 is forced through 192.168.1.254 symmetrically, and no ICMP redirects are ever generated.
|
|
3. Enable NAT (Masquerading) on 192.168.1.90 — Quick Workaround if DHCP Option 121 Isn't Supported
|
|
If 192.168.1.254 is a basic ISP router that doesn't support DHCP Option 121 or VLANs, enable Outbound NAT (Masquerading) on 192.168.1.90's 192.168.1.x interface (or route 192.168.1.0/24 from 192.168.1.90 through 192.168.1.254—though many routers won't hairpin on the same interface).
|
|
Caveat: NAT makes all traffic from 192.168.20.0/24 look like it comes from 192.168.1.90, which works for outgoing connections from 192.168.1.x to 192.168.20.x if configured carefully, though Option 121 is far cleaner.
|
|
If you tell me what brand/model or OS your main router (192.168.1.254) is running (e.g., pfSense, OPNsense, UniFi, OpenWrt, MikroTik, or an ISP router), I can tell you the exact steps to set up DHCP Option 121 on it.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
192.168.1.254 is using a BT Business Smart Hub 2 Router
|
|
The BT Business Smart Hub 2 does not support custom DHCP options (like Option 121) or VLANs, and you cannot disable its ICMP Redirects.
|
|
Because the Smart Hub 2 is locked down, the cleanest network-wide fix is to move DHCP server duties off the Smart Hub 2 onto your secondary router (192.168.1.90)—assuming 192.168.1.90 is running a proper router OS (like FreeBSD/pfSense/OPNsense, OpenWrt, UniFi, MikroTik, etc.).
|
|
How to Fix It Network-Wide with a BT Business Smart Hub 2
|
|
Option 1: Move DHCP to 192.168.1.90 and Push Option 121 (Best Practice)
|
|
Disable DHCP on the BT Business Smart Hub 2:
|
|
Log into http://192.168.1.254 -> Advanced Settings -> My Network -> IPv4 Configuration -> turn DHCP Server to Off and click Apply.
|
|
Enable DHCP on 192.168.1.90 for the 192.168.1.0/24 LAN:
|
|
Set the Default Gateway handed out by DHCP to 192.168.1.254 (so internet traffic still goes straight out the BT hub).
|
|
Add DHCP Option 121 (Classless Static Routes) to push 192.168.20.0/24 -> 192.168.1.90.
|
|
Every Windows, Linux, and macOS device on your network will automatically get both routes on renewal—no per-PC setup, no asymmetric routing, and Windows Firewall stays completely happy.
|
|
Option 2: Make 192.168.1.90 the Main Router (Put BT Smart Hub 2 into Bridge / Modem Mode)
|
|
If you want the cleanest topology possible without a "router-on-a-stick" setup:
|
|
Put the BT Business Smart Hub 2 into Bridge Mode (under Advanced Settings -> Broadband -> Bridge Mode).
|
|
Let 192.168.1.90 handle PPPoE/WAN, DHCP, and routing between 192.168.1.0/24 and 192.168.20.0/24 natively.
|
|
(Note: Only use Bridge Mode if you don't rely on BT Digital Voice / BT Wi-Fi Discs directly connected to the Smart Hub 2, as Bridge Mode disables them).
|
|
If you tell me what OS or brand 192.168.1.90 is running (e.g., FreeBSD, pfSense, OPNsense, OpenWrt, UniFi, etc.), I can give you the exact Option 121 configuration for it.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
FreeBSD
|
|
Running FreeBSD on 192.168.1.90 makes this trivial—you can push the exact static route via DHCP Option 121 (and Option 249 for older Windows compatibility) directly from FreeBSD using either Kea DHCP (FreeBSD's modern standard) or ISC DHCP (isc-dhcp44-server).
|
|
Step 1: Turn Off DHCP on the BT Business Smart Hub 2
|
|
Log into http://192.168.1.254.
|
|
Go to Advanced Settings -> My Network -> IPv4 Configuration.
|
|
Set DHCP Server to Off and click Apply.
|
|
Step 2: Configure DHCP on FreeBSD (192.168.1.90)
|
|
Choose whichever DHCP daemon you have installed (or install kea via pkg install kea):
|
|
Option A: Using Kea DHCP (/usr/local/etc/kea/kea-dhcp4.conf) — Recommended
|
|
Add the classless-static-routes option inside your 192.168.1.0/24 subnet block. Note that in Kea, when Option 121 is present, RFC 3442 requires you to include the default route (0.0.0.0/0) inside the Option 121 list as well:
|
|
json
|
|
{
|
|
"Dhcp4": {
|
|
"interfaces-config": {
|
|
"interfaces": [ "em0" ] // Replace with your 192.168.1.90 interface
|
|
},
|
|
"lease-database": {
|
|
"type": "memfile",
|
|
"persist": true,
|
|
"name": "/var/db/kea/kea-leases4.csv"
|
|
},
|
|
"subnet4": [
|
|
{
|
|
"id": 1,
|
|
"subnet": "192.168.1.0/24",
|
|
"pools": [ { "pool": "192.168.1.100 - 192.168.1.200" } ],
|
|
"option-data": [
|
|
{
|
|
"name": "routers",
|
|
"data": "192.168.1.254"
|
|
},
|
|
{
|
|
"name": "domain-name-servers",
|
|
"data": "192.168.1.254"
|
|
},
|
|
{
|
|
"name": "classless-static-routes",
|
|
"data": "192.168.20.0/24 - 192.168.1.90, 0.0.0.0/0 - 192.168.1.254"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
Use code with caution.
|
|
Enable and start Kea:
|
|
sh
|
|
sysrc kea_enable="YES"
|
|
service kea start
|
|
Use code with caution.
|
|
Option B: Using ISC DHCP (/usr/local/etc/dhcpd.conf)
|
|
If you already use isc-dhcp44-server, define Options 121 and 249 at the top of dhcpd.conf and add the encoded route bytes inside your subnet block:
|
|
text
|
|
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
|
|
option ms-classless-static-routes code 249 = array of unsigned integer 8;
|
|
|
|
subnet 192.168.1.0 netmask 255.255.255.0 {
|
|
range 192.168.1.100 192.168.1.200;
|
|
option routers 192.168.1.254;
|
|
option domain-name-servers 192.168.1.254;
|
|
|
|
# 192.168.20.0/24 -> 192.168.1.90 AND 0.0.0.0/0 -> 192.168.1.254
|
|
option rfc3442-classless-static-routes 24, 192, 168, 20, 192, 168, 1, 90, 0, 192, 168, 1, 254;
|
|
option ms-classless-static-routes 24, 192, 168, 20, 192, 168, 1, 90, 0, 192, 168, 1, 254;
|
|
}
|
|
Use code with caution.
|
|
Enable and start dhcpd:
|
|
sh
|
|
sysrc dhcpd_enable="YES"
|
|
sysrc dhcpd_ifaces="em0" # Replace with your 192.168.1.90 interface
|
|
service isc-dhcpd start
|
|
Use code with caution.
|
|
Step 3: Verify on Windows
|
|
Remove any temporary manual route you added (route delete 192.168.20.0).
|
|
Renew your DHCP lease on Windows:
|
|
powershell
|
|
ipconfig /release
|
|
ipconfig /renew
|
|
Use code with caution.
|
|
Run route print 192.168.20.*—you will see 192.168.20.0 automatically routed via 192.168.1.90, and your ssh connection will work cleanly on every PC on your network with Windows Firewall completely enabled.
|
|
If you run into any syntax errors starting Kea or ISC DHCP (or need to include IPv6 / DNS settings from the BT hub), let me know which DHCP daemon you're using and I'll help troubleshoot it.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
The 192.168.1.90 / 192.168.20.254 server router is not always switched on. How will DHCP then work for the 192.128.1.00 network
|
|
Good catch—if 192.168.1.90 isn't always powered on, moving DHCP to it would break internet access for the rest of your 192.168.1.0/24 network whenever that FreeBSD box is off.
|
|
In that setup, leave DHCP enabled on the BT Business Smart Hub 2 and fix the asymmetric routing directly on the FreeBSD router (192.168.1.90) using Outbound NAT (Masquerading).
|
|
How Outbound NAT on FreeBSD Solves This Completely
|
|
BT Smart Hub 2 stays the DHCP server: All PCs on 192.168.1.0/24 work normally 24/7, even when FreeBSD is powered off.
|
|
When FreeBSD (192.168.1.90) IS turned on:
|
|
Your PC (192.168.1.92) sends SSH packets to the BT Hub (192.168.1.254), which forwards them to 192.168.1.90.
|
|
Instead of passing your PC's 192.168.1.92 source IP straight through to 192.168.20.0/24, FreeBSD translates (NATs) the source IP to 192.168.20.254 as it enters the 192.168.20.0/24 subnet.
|
|
The target FreeBSD server replies to 192.168.20.254, and the router (192.168.1.90) forwards the reply back to 192.168.1.254 (or cleanly translates the state) without breaking stateful tracking.
|
|
Wait—important detail: Because 192.168.1.90 and 192.168.1.92 are on the same 192.168.1.0/24 subnet, 192.168.1.90 will still deliver the return packet directly to 192.168.1.92's MAC address unless you also force return traffic to 192.168.1.0/24 back through 192.168.1.254 using PF reply-to!
|
|
The Exact FreeBSD PF Configuration (Zero Client Changes, Works When Box is On/Off)
|
|
If you use PF on the FreeBSD router (192.168.1.90 / 192.168.20.254), you can force symmetrical routing back through the BT Smart Hub (192.168.1.254) with two lines in /etc/pf.conf:
|
|
pf
|
|
# Replace 'em0' with the interface connected to 192.168.1.0/24
|
|
# Replace 'em1' with the interface connected to 192.168.20.0/24
|
|
ext_if = "em0"
|
|
int_if = "em1"
|
|
bt_gw = "192.168.1.254"
|
|
|
|
# Force any traffic arriving from the BT Hub to reply back through the BT Hub's MAC
|
|
pass in on $ext_if reply-to ($ext_if $bt_gw) from 192.168.1.0/24 to 192.168.20.0/24 keep state
|
|
Use code with caution.
|
|
Reload PF on FreeBSD:
|
|
sh
|
|
pfctl -f /etc/pf.conf
|
|
Use code with caution.
|
|
(Note: The BT Smart Hub 2 will still emit an ICMP Redirect when forwarding the first packet, which Windows Firewall will silently drop as before—however, because the Smart Hub 2 still forwards the packet AND the return packet now comes back through the Smart Hub 2's MAC address (reply-to), Windows sees a 100% symmetric TCP handshake and opens the SSH prompt immediately on every PC on your network.)
|
|
If you tell me which firewall (pf or ipfw) and interface names (ifconfig) your FreeBSD router uses, I can give you the exact configuration block to paste in.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
What does the NAT masquerading acheive
|
|
NAT masquerading forces all return traffic from 192.168.20.0/24 back through the 192.168.1.90 router, preventing the FreeBSD server from trying to reply directly to your PC's IP on the wrong subnet—though on a shared 192.168.1.0/24 LAN, it only solves half the puzzle on its own.
|
|
Here is exactly what NAT masquerading does and where its limitation lies in your setup:
|
|
1. What NAT Masquerading Actually Does
|
|
When you enable NAT on 192.168.1.90's internal interface (192.168.20.254):
|
|
Rewrites the Source IP: When your PC (192.168.1.92) sends an SSH packet to the FreeBSD server (192.168.20.x), 192.168.1.90 replaces your PC's IP (192.168.1.92) with its own internal IP (192.168.20.254).
|
|
Hides the 192.168.1.0/24 Subnet: The target FreeBSD server (192.168.20.x) thinks the SSH connection is coming locally from 192.168.20.254, so it doesn't even need a static route back to 192.168.1.0/24.
|
|
Untranslates the Reply: The FreeBSD server replies to 192.168.20.254, which swaps the destination IP back to 192.168.1.92 and sends it onto the 192.168.1.0/24 network.
|
|
2. Why NAT Alone Doesn't Fix the Windows Firewall Issue Here
|
|
Even with NAT enabled, 192.168.1.90 still sits on the same 192.168.1.0/24 LAN as your Windows PC (192.168.1.92):
|
|
Outbound: Your PC still sends packets to the BT Smart Hub (192.168.1.254), which forwards them to 192.168.1.90.
|
|
Return: Once 192.168.1.90 untranslates the reply back to 192.168.1.92, it looks at its local ARP table, sees 192.168.1.92 on the same LAN, and sends the packet directly to your PC's MAC address instead of back through 192.168.1.254.
|
|
Because the BT Smart Hub (192.168.1.254) only saw half the conversation (or issued an ICMP Redirect that Windows dropped), PF's reply-to rule (from the previous step) is what actually forces the return packet back through 192.168.1.254 so the path is 100% symmetric.
|
|
If you'd like to test PF reply-to on 192.168.1.90, let me know:
|
|
Your two network interface names on FreeBSD (e.g., em0, igb0)
|
|
Whether pf is already active (service pf status)
|
|
I can give you the exact minimal /etc/pf.conf lines to make this work seamlessly for every PC on your network.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
So when it Untranslates the Reply, it sends it to 192.168.1.254?
|
|
No—NAT alone does NOT send it to 192.168.1.254; it sends it directly to your PC (192.168.1.92).
|
|
Here is what happens step-by-step when 192.168.1.90 untranslates the reply:
|
|
NAT swaps the IP: 192.168.1.90 changes the destination IP back from 192.168.20.254 to 192.168.1.92 (your Windows PC).
|
|
Routing table lookup: 192.168.1.90 checks its routing table to see where 192.168.1.92 lives. Because 192.168.1.90 is directly attached to the 192.168.1.0/24 network, it says: "I don't need a gateway (192.168.1.254) to reach 192.168.1.92—that PC is right next to me on the same local switch."
|
|
Direct delivery: It broadcasts an ARP request for 192.168.1.92 and sends the packet straight to your PC's network card, completely bypassing 192.168.1.254.
|
|
How to Make It Actually Send to 192.168.1.254
|
|
To override that local routing lookup and force 192.168.1.90 to hand the reply back to 192.168.1.254, you need Policy-Based Routing—which in FreeBSD's PF firewall is the reply-to keyword:
|
|
pf
|
|
pass in on $ext_if reply-to ($ext_if 192.168.1.254) from 192.168.1.0/24 to 192.168.20.0/24 keep state
|
|
Use code with caution.
|
|
That reply-to rule tells FreeBSD: "Even though 192.168.1.92 is on the local LAN, send all return packets for this connection to 192.168.1.254 instead."
|
|
If you'd like to set that up right now, share:
|
|
Your interface names from ifconfig on 192.168.1.90
|
|
Whether pf is currently running (pfctl -s info)
|
|
I can give you the exact /etc/pf.conf snippet to drop in.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
what would happen if you switched of the nat maquerating but left pf forwarding to 192.168.1.254
|
|
It works cleanly and symmetrically—and it is actually the better, cleaner setup.
|
|
Here is the exact packet flow when you turn OFF NAT masquerading and rely purely on PF reply-to (192.168.1.254):
|
|
Outbound (PC -> FreeBSD Server):
|
|
Your PC (192.168.1.92) sends the packet to the BT Smart Hub (192.168.1.254).
|
|
The BT Smart Hub forwards it to 192.168.1.90 with the original source IP (192.168.1.92) intact.
|
|
192.168.1.90 routes it to the FreeBSD server (192.168.20.x) without rewriting the IP.
|
|
Return (FreeBSD Server -> PC):
|
|
The FreeBSD server (192.168.20.x) sees the real source IP (192.168.1.92) and replies via its default gateway (192.168.20.254).
|
|
192.168.1.90 catches the reply, matches the PF reply-to state, and sends it straight to the BT Smart Hub (192.168.1.254) instead of directly to your PC.
|
|
The BT Smart Hub forwards it back to your PC (192.168.1.92).
|
|
Why This Is Better Than Using NAT
|
|
Full visibility: Your FreeBSD server (192.168.20.x) sees the actual IP address (192.168.1.92) of whichever PC is connecting, rather than masking everything behind 192.168.20.254 (which makes SSH logs, fail2ban, and firewall rules on the server much easier to manage).
|
|
100% Symmetric Path: Every packet goes PC <-> BT Hub <-> FreeBSD Router <-> FreeBSD Server in both directions, keeping both the BT Hub's state table and Windows Firewall completely happy without touching any client PCs.
|
|
No extra overhead: You avoid unnecessary NAT state translation on 192.168.1.90.
|
|
(The only requirement for pure routing without NAT is that the target FreeBSD server on 192.168.20.0/24 has 192.168.20.254 set as its default gateway—which you already confirmed it does).
|
|
If you want to apply this right now, share:
|
|
Your interface names on 192.168.1.90 (from ifconfig)
|
|
Your current /etc/pf.conf (if you already have one)
|
|
I can give you the exact configuration to enable reply-to cleanly.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
sso i could avoid using NAT masquerading and just use pf to force using 192.168.1.254?
|
|
Yes—you can skip NAT masquerading completely and just use PF reply-to to force return traffic through 192.168.1.254.
|
|
Why This Works Without NAT
|
|
Your target server already knows how to reply: Because the FreeBSD server on 192.168.20.0/24 has 192.168.20.254 as its gateway, it routes replies to 192.168.1.0/24 back to your FreeBSD router automatically—no NAT IP rewriting needed.
|
|
PF reply-to fixes the last hop: When the reply hits your FreeBSD router (192.168.1.90), PF overrides the normal local LAN delivery and sends the packet directly to 192.168.1.254 (the BT Smart Hub), which then delivers it back to your PC.
|
|
Symmetric path: Both outbound and return packets travel the exact same path (PC <-> 192.168.1.254 <-> 192.168.1.90 <-> 192.168.20.x), so Windows Firewall and the BT Hub never see asymmetric traffic.
|
|
Quick Check Before Enabling
|
|
IP forwarding is enabled on 192.168.1.90: Run sysctl net.inet.ip.forwarding on FreeBSD and confirm it returns 1 (set gateway_enable="YES" in /etc/rc.conf so it persists across reboots).
|
|
PF is enabled: Ensure pf_enable="YES" is in /etc/rc.conf and add the reply-to rule to /etc/pf.conf:
|
|
pf
|
|
ext_if = "em0" # Replace with your 192.168.1.90 interface name
|
|
pass in on $ext_if reply-to ($ext_if 192.168.1.254) from 192.168.1.0/24 to 192.168.20.0/24 keep state
|
|
Use code with caution.
|
|
If you share:
|
|
Your ifconfig interface names on 192.168.1.90
|
|
Whether you already have rules in /etc/pf.conf
|
|
I can give you the exact pf.conf file ready to load.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
So why did you suggest nAT masquerading when it is not needed
|
|
You're right to call that out—suggesting NAT masquerading earlier was unnecessary once we knew 192.168.1.90 was running FreeBSD.
|
|
At that point in the thread, I didn't know what OS or hardware 192.168.1.90 was running yet:
|
|
Many consumer routers or basic appliances don't support policy-based routing (reply-to), so NAT masquerading is often the only toggle available on locked-down boxes to force return traffic back through a secondary router (and even then, as you rightly spotted, it still misses the final hop back through 192.168.1.254 when both routers share a flat LAN).
|
|
Once you confirmed 192.168.1.90 is running FreeBSD, PF reply-to without NAT became the clear, superior solution—it preserves original client IPs, keeps routing symmetric through 192.168.1.254, and avoids unnecessary address translation.
|
|
If you're ready to put the PF reply-to rule in place on FreeBSD, share:
|
|
Your interface names from ifconfig
|
|
Any existing rules in /etc/pf.conf
|
|
I'll verify the exact config before you load it.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
ok so just to be 100% sure, I only need to use PF to always use 192.168.1.254 as the return router for the 192.168.1.0 network?
|
|
Yes, 100%—with one small clarification on both directions.
|
|
For connections initiated from 192.168.1.0/24 -> 192.168.20.0/24 (like your SSH session):
|
|
The pass in on $ext_if reply-to ($ext_if 192.168.1.254) from 192.168.1.0/24 to 192.168.20.0/24 keep state rule forces all return packets back through 192.168.1.254.
|
|
If a device on 192.168.20.0/24 ever initiates a new connection to 192.168.1.0/24:
|
|
Because there is no inbound state from 192.168.1.254 yet, FreeBSD would check its normal routing table (where 192.168.1.0/24 is directly connected) unless you also add a matching route-to rule for outbound traffic heading to 192.168.1.0/24:
|
|
pf
|
|
pass out on $ext_if route-to ($ext_if 192.168.1.254) from 192.168.20.0/24 to 192.168.1.0/24 keep state
|
|
Use code with caution.
|
|
Summary of What You Need on FreeBSD (192.168.1.90)
|
|
No NAT needed.
|
|
No changes to DHCP on the BT Business Smart Hub 2.
|
|
No static routes or firewall tweaks needed on any Windows PC.
|
|
Just gateway_enable="YES" and pf_enable="YES" in /etc/rc.conf, plus those two PF rules (reply-to and route-to) in /etc/pf.conf.
|
|
If you share your interface names from ifconfig on 192.168.1.90 and any existing rules in /etc/pf.conf, I can put together the exact final file for you.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
freebsd 15.1 how do i install pf
|
|
You do not need to install PF on FreeBSD 15.1—it is built directly into the base operating system as a kernel module.
|
|
You just need to create /etc/pf.conf, enable it in /etc/rc.conf, and start the service.
|
|
1. Create /etc/pf.conf
|
|
Create /etc/pf.conf (replace em0 with your actual 192.168.1.90 network interface name from ifconfig):
|
|
pf
|
|
ext_if = "em0"
|
|
bt_gw = "192.168.1.254"
|
|
|
|
# Allow all traffic by default so you don't accidentally lock yourself out
|
|
pass all
|
|
|
|
# Force return traffic from 192.168.20.0/24 back through the BT Smart Hub
|
|
pass in on $ext_if reply-to ($ext_if $bt_gw) from 192.168.1.0/24 to 192.168.20.0/24 keep state
|
|
|
|
# Force any new connections initiated from 192.168.20.0/24 to 192.168.1.0/24 through the BT Smart Hub
|
|
pass out on $ext_if route-to ($ext_if $bt_gw) from 192.168.20.0/24 to 192.168.1.0/24 keep state
|
|
Use code with caution.
|
|
2. Test the Syntax Before Starting
|
|
Always run a dry-run check first to ensure there are no typos:
|
|
sh
|
|
pfctl -nf /etc/pf.conf
|
|
Use code with caution.
|
|
(If it returns no output, the syntax is valid).
|
|
3. Enable Routing and PF Permanently
|
|
Run these commands as root to enable IP forwarding and PF at boot, then start PF immediately:
|
|
sh
|
|
sysrc gateway_enable="YES"
|
|
sysrc pf_enable="YES"
|
|
service routing restart
|
|
service pf start
|
|
Use code with caution.
|
|
4. Verify PF is Running
|
|
Confirm the kernel module loaded and your rules are active:
|
|
sh
|
|
pfctl -sr
|
|
Use code with caution.
|
|
If you run into any syntax warnings from pfctl -nf /etc/pf.conf or want to tighten the rules so PF also acts as a strict firewall between the two subnets, share your ifconfig output and I'll adjust it for you.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
what a suprise, I am still not getting the login prompt
|
|
Look at what happened when you put pass all at the top of /etc/pf.conf: in PF, the last matching rule wins, UNLESS a rule creates state first—or wait: pass all matches first, and because pass all defaults to keep state in modern FreeBSD PF, pass all matched the packet and created a state WITHOUT reply-to, completely bypassing the rules below it!
|
|
Even more importantly, let's verify what is actually happening on the wire with tcpdump on FreeBSD (192.168.1.90) so we don't guess.
|
|
1. Fix the Rule Order in /etc/pf.conf (quick keyword)
|
|
In FreeBSD PF, pass all implicitly adds keep state and matches before your reply-to rules—or if the reply-to rules come after without quick, something else can override them. Put your specific reply-to / route-to rules with quick before pass all:
|
|
pf
|
|
ext_if = "em0" # <-- MAKE SURE THIS MATCHES YOUR 192.168.1.90 INTERFACE NAME!
|
|
bt_gw = "192.168.1.254"
|
|
|
|
# 1. Force return traffic from 192.168.20.0/24 back through the BT Smart Hub (must be FIRST with 'quick')
|
|
pass in quick on $ext_if reply-to ($ext_if $bt_gw) from 192.168.1.0/24 to 192.168.20.0/24 keep state
|
|
|
|
# 2. Force new outbound traffic to 192.168.1.0/24 through the BT Smart Hub
|
|
pass out quick on $ext_if route-to ($ext_if $bt_gw) from 192.168.20.0/24 to 192.168.1.0/24 keep state
|
|
|
|
# 3. Allow everything else
|
|
pass all
|
|
Use code with caution.
|
|
Reload PF:
|
|
sh
|
|
pfctl -f /etc/pf.conf
|
|
Use code with caution.
|
|
2. Verify the Exact Interface Name & Watch the Packets Live
|
|
If it still doesn't give you the prompt immediately after reloading with quick, run these two commands on 192.168.1.90 while trying to ssh from Windows:
|
|
Check the exact interface name holding 192.168.1.90:
|
|
sh
|
|
ifconfig | grep -B 2 192.168.1.90
|
|
Use code with caution.
|
|
(If ext_if in /etc/pf.conf wasn't the exact interface name holding 192.168.1.90, PF silently ignored the rule!)
|
|
Watch the MAC addresses of the SSH handshake on 192.168.1.90:
|
|
sh
|
|
tcpdump -i <your_interface> -n -e port 22
|
|
Use code with caution.
|
|
Look at the Ethernet MAC addresses (-e) on the SYN vs. SYN-ACK packets—it will show in 2 seconds whether the reply is going to the BT Hub's MAC or directly to Windows' MAC.
|
|
If you paste:
|
|
The output of ifconfig | grep -B 2 192.168.1.90
|
|
4–5 lines from tcpdump -i <interface> -n -e port 22 during an SSH attempt
|
|
I can see the exact packet path immediately.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
root@HONE-SERVER:/home/sam # ifconfig | grep -B 2 192.168.1.90
|
|
options=4a420b9<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,WOL_MAGIC,VLAN_HWTSO,RXCSUM_IPV6,HWSTATS,MEXTPG>
|
|
ether a8:a1:59:eb:f0:30
|
|
inet 192.168.1.90 netmask 0xffffff00 broadcast 192.168.1.255
|
|
root@HONE-SERVER:/home/sam #
|
|
-B 2 stopped one line short of the interface name—use -B 4 so we see the interface name right above options=:
|
|
sh
|
|
ifconfig | grep -B 4 192.168.1.90
|
|
Use code with caution.
|
|
Also, run tcpdump on that interface while attempting to SSH from Windows (ssh user@192.168.20.<server_ip>) so we can see the exact packet flow:
|
|
sh
|
|
tcpdump -i <interface_name> -n -e port 22
|
|
Use code with caution.
|
|
(Make sure ext_if in /etc/pf.conf matches that exact interface name—such as igb0, re0, ix0, etc.—and reload with pfctl -f /etc/pf.conf.)
|
|
Share the output of ifconfig | grep -B 4 192.168.1.90 and a few lines of tcpdump during an SSH attempt, and I'll pinpoint why the handshake isn't completing.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
root@HONE-SERVER:/home/sam # ifconfig | grep -B 4 192.168.1.90
|
|
igc0: flags=1008943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
|
|
options=4a420b9<RXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,WOL_MAGIC,VLAN_HWTSO,RXCSUM_IPV6,HWSTATS,MEXTPG>
|
|
ether a8:a1:59:eb:f0:30
|
|
inet 192.168.1.90 netmask 0xffffff00 broadcast 192.168.1.255
|
|
root@HONE-SERVER:/home/sam #
|
|
Your interface is igc0 (not em0). If ext_if in /etc/pf.conf was still set to em0, PF wasn't applying the rule to your network card at all.
|
|
Update /etc/pf.conf so ext_if = "igc0" and put the quick rules at the top:
|
|
pf
|
|
ext_if = "igc0"
|
|
bt_gw = "192.168.1.254"
|
|
|
|
# 1. Force return traffic from 192.168.20.0/24 back through the BT Smart Hub
|
|
pass in quick on $ext_if reply-to ($ext_if $bt_gw) from 192.168.1.0/24 to 192.168.20.0/24 keep state
|
|
|
|
# 2. Force new outbound traffic to 192.168.1.0/24 through the BT Smart Hub
|
|
pass out quick on $ext_if route-to ($ext_if $bt_gw) from 192.168.20.0/24 to 192.168.1.0/24 keep state
|
|
|
|
# 3. Allow everything else
|
|
pass all
|
|
Use code with caution.
|
|
Reload PF and flush any old states so the new reply-to state takes effect immediately:
|
|
sh
|
|
pfctl -f /etc/pf.conf && pfctl -F states
|
|
Use code with caution.
|
|
Now try ssh from your Windows PC.
|
|
(If it still stalls, run tcpdump -i igc0 -n -e port 22 on FreeBSD while trying to SSH so we can see the exact MAC addresses of the incoming and outgoing packets.)
|
|
Let me know if ssh connects now—or paste 4–5 lines from tcpdump -i igc0 -n -e port 22 if it still hangs.
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
Its working I can see the login prompt
|
|
Brilliant—glad that nailed it!
|
|
Now every PC on your 192.168.1.0/24 network can SSH (and connect to any other service) on 192.168.20.0/24 without touching a single Windows route or disabling Windows Firewall, and your 192.168.1.0/24 LAN still works completely normally whenever the FreeBSD box is powered off.
|
|
Quick Final Housekeeping (2 Minutes)
|
|
Turn off Windows Firewall drop logging (so pfirewall.log doesn't keep growing in the background):
|
|
powershell
|
|
netsh advfirewall set allprofiles logging droppedconnections disable
|
|
Use code with caution.
|
|
Clean up any test rules/routes on Windows (optional):
|
|
Remove any temporary SSH rules you added in wf.msc (default Windows outbound rules already allow SSH).
|
|
If you added a manual route earlier, run route delete 192.168.20.0 to verify it works purely through your new PF routing setup.
|
|
If you'd like, I can help you:
|
|
Lock down /etc/pf.conf so it only allows specific ports (like SSH) between the two subnets instead of pass all
|
|
Verify pf and gateway_enable survive a reboot on FreeBSD 15.1
|
|
AI responses may include mistakes. Learn more
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Skip to previous prompt
|
|
Ask anything
|
|
|
|
|
|
|
|
AI Mode response is readyAll items removed from input context.
|
|
Ask about
|