Newer
Older
gnexus-book / 10-systems / networks / pfsense-router.md

owner: gmikcon status: active last_reviewed: 2026-10-03 review_interval: 90d confidence: high

source_of_truth: owner-provided-firewall-log-and-macvendors

pfSense Router

Central router and firewall for the local network.

Access

  • Web UI: https://192.168.1.1/
  • SSH: ai_agent_ro@192.168.1.1:22, read-only access for documentation agents.
  • SSH authentication: owner-managed key. The private key gnexus_book_pfsense_ro is stored on the owner's PC gmikcon (192.168.1.129, dynamic DHCP address) at ~/.ssh/gnexus_book_pfsense_ro. Agents without direct access can reach pfSense through that PC over SSH (password auth, see gnexus-creds secret gbook-creds).
  • Secret values are not stored in this repository.

Read-only account limitations (verified 2026-09-29)

  • ai_agent_ro (uid 2000, group nobody) can run basic commands (date, ls, id, cat /etc/ssh/sshd_config) but CANNOT read /var/log/* — all logs are root:wheel mode 600.
  • No sudo, no clog binary in PATH, no Match/ForceCommand block in sshd_config — the restriction is plain file permissions.
  • WAN outage analysis must therefore use alternative sources: NetworkManager connectivity logs on LAN hosts (journalctl | grep "state is now"), OpenVPN reconnect logs on tunnel endpoints, or the pfSense Web UI (owner).
  • The default shell for ai_agent_ro is csh; complex one-liners must be wrapped as sh -c '...' (nested quoting is fragile — build the command programmatically).

Role

  • Local network edge.
  • Firewall and routing point for internal infrastructure.
  • DHCP server for home-lan and home-iot-lan.
  • Local DNS resolver through Unbound.
  • Local NTP endpoint.
  • Part of the path between local infrastructure and services reachable through trusted network paths.

Platform

  • Hostname: pfSense.home.arpa.
  • OS: pfSense CE 2.7.2.
  • Base system observed over SSH: FreeBSD 14.0-CURRENT, amd64.

Interfaces

Interface Description Role Address MAC Status
re0 LANTECH home-iot-lan 192.168.2.1/24 00:e0:4c:68:07:9f active, 1000baseT full-duplex
re1 none unused none 00:e0:4c:68:39:03 no carrier
re2 LANMAIN home-lan 192.168.1.1/24 00:e0:4c:68:35:ba active, 1000baseT full-duplex
re3 WAN WAN uplink 172.32.2.78/24 70:85:c2:24:ee:4b active, 1000baseT full-duplex

Routing

Observed routes:

  • Default route: 172.32.2.1 through re3.
  • 192.168.1.0/24 is directly connected through re2.
  • 192.168.2.0/24 is directly connected through re0.
  • Host routes for 8.8.8.8 and 2.2.2.2 are present through re3.

WAN L2 Domain (verified 2026-10-03)

The WAN interface re3 (172.32.2.0/24) shares a flat, unfiltered L2 segment with other ISP clients — it is not an isolated point-to-point uplink.

Evidence from arp -a over SSH (ai_agent_ro):

  • 169 ARP entries on re3 (including own address 172.32.2.78 and gateway 172.32.2.1 at d4:01:c3:6b:86:b9); roughly 160+ distinct neighbor MACs of other ISP clients.
  • Examples: 172.32.2.5 → 54:ef:33:4b:5a:3d, 172.32.2.46 → 20:32:33:ea:b3:5a, 172.32.2.104 → 54:ef:33:4b:5a:a3, 172.32.2.106 → 00:e0:4c:8d:6b:06, 172.32.2.141 → d4:da:21:1d:ba:f0, 172.32.2.195 → 48:8f:5a:3b:3c:32.
  • ICMP ping from pfSense to 20 sampled neighbor addresses (172.32.2.5, .23, .33, .45, .46, .48, .81, .85, .92, .104, .106, .128, .141, .146, .155, .161, .195, .212, .219, .250): 17/20 replied; .106, .141, .219 did not answer ICMP but their MACs were present in ARP — ICMP is partially filtered by client firewalls, ARP is the reliable indicator.
  • Implication: other ISP subscribers are on the same broadcast domain; treat WAN-side exposure seriously (no trusted traffic on 172.32.2.0/24, firewall rules on WAN should assume hostile neighbors).

A friend of the owner is on the same ISP and the same WAN L2 segment, enabling a direct low-latency peer link.

  • Friend WAN: 172.32.2.120, MAC 24:2f:d0:7e:96:d9 (TP-Link Archer C6, stock firmware; hardware version to be confirmed from the bottom sticker).
  • Stock Archer C6 VPN support depends on hardware version (TP-Link official FAQ 1544, archived 2023-12): Archer C6 v2 officially supports OpenVPN server in stock firmware (Advanced > VPN Server > OpenVPN, plus PPTP); Archer A6 v2/v3 also listed. C6 v3 (MediaTek MT7621) and v4 are NOT in the official list — verify in the web UI (Advanced > VPN Server) or product specs. No WireGuard on stock firmware for any C6 version.
  • OpenWrt is supported on all C6 hardware versions (16 MiB flash / 128 MiB RAM), flashable from the stock web UI with the factory image; recovery page exists (power-cycle x4).
  • Friend LAN: 192.168.0.0/24, gateway 192.168.0.1 (from his tracert to 8.8.8.8).
  • Identification method: owner read pfSense Web UI firewall log (Status → System Logs → Firewall) while the friend ran a continuous ping 172.32.2.78; the log showed a wall of ICMP echo-requests from 172.32.2.120 to 172.32.2.78 blocked by the default deny rule (1000000103) every second.
  • Our WAN blocks inbound ICMP by default (default deny rule), so the friend's ping times out; outbound pings from our side to 172.32.2.120 also get no replies (his router filters inbound ICMP) — inbound TCP to forwarded ports is NOT filtered by the ISP (verified: other segment neighbors answer on TCP ports).
  • Candidate approaches (owner decision pending hardware version):
    1. If his C6 has OpenVPN server in stock (v2 or menu present): OpenVPN server on his C6 + pfSense OpenVPN client on our side; static route on his C6 for return traffic to 192.168.1.0/24 for bidirectional access.
    2. SSH port-forward proxy scheme (no tunnels, works on any stock firmware): OpenSSH on his PC + port forward on his C6 (WAN 2222 → his PC 22); pfSense NAT port forward WAN 2200 → our gateway host 22 with source restriction 172.32.2.120/32.
    3. WireGuard upgrade path: OpenWrt on his C6 or WG on his PC; pfSense side ready (verified 2026-10-03: wg binary in base system, /boot/kernel/if_wg.ko module present, WireGuard built into pfSense 2.7.2 Web UI). Our WAN is DHCP (dhclient on re3) — both endpoints may change IP.

Stable identifier and rediscovery

  • The friend's WAN IP is DHCP-assigned and may change on lease renewal. The MAC 24:2f:d0:7e:96:d9 is the stable identifier. The pfSense WAN DHCP lease file (/var/db/dhclient.leases.re3) is root-only readable through ai_agent_ro, so lease duration is unknown — assume the friend's lease can change at any time.
  • Rediscovery procedure if the friend's WAN IP changes:
    1. Preferred: the friend runs a continuous ping to 172.32.2.78; the owner reads the pfSense firewall log (Status → System Logs → Firewall, filter ICMP) — the source IP of the ICMP wall is his new WAN address.
    2. Without his cooperation: scan the segment (nmap -sn 172.32.2.0/24 from a LAN host), then read arp -a on pfSense re3 and match the MAC prefix 24:2F:D0 (TP-Link OUI). Other TP-Link routers in the segment may share the prefix — verify candidates with the ping-trap from step 1.
  • Note: inbound packets do not refresh ARP entries on FreeBSD — ARP snapshots alone cannot distinguish an active pinger from a stale entry; use the firewall log as the source of truth for active traffic.

Local Services

Observed listening services:

  • SSH: *:22.
  • Web UI through nginx: *:80, *:443.
  • DHCPv4 through Kea: 192.168.1.1:67, 192.168.2.1:67.
  • DNS resolver through Unbound: *:53.
  • Unbound control: 127.0.0.1:953.
  • Syslog: UDP *:514.
  • NTP: UDP *:123, including bindings on 192.168.1.1, 192.168.2.1, 172.32.2.78, and 127.0.0.1.

Resolver configuration:

  • 127.0.0.1
  • 8.8.8.8
  • 2.2.2.2
  • Search domain: home.arpa

Local Network Topology

The home network currently consists of two local networks implemented through one custom router with multiple network interfaces.

Each local network goes from the router into a switch and then is distributed through the home. The access layer includes wired TVs, PCs, servers, and Wi-Fi access points.

Home LAN

  • Inventory id: home-lan.
  • CIDR: 192.168.1.0/24.
  • Gateway: 192.168.1.1.
  • Router interface: re2 / LANMAIN.
  • Main Wi-Fi SSID: home.
  • Wi-Fi mode: access points, not a separate routed Wi-Fi network.
  • Access points: 2 nodes.
  • Mesh mode: enabled for the main Wi-Fi nodes.

Home IoT LAN

  • Inventory id: home-iot-lan.
  • CIDR: 192.168.2.0/24.
  • Gateway: 192.168.2.1.
  • Router interface: re0 / LANTECH.
  • Purpose: service network for smart-home and IoT devices.
  • Wi-Fi mode: access points, not a separate routed Wi-Fi network.
  • IoT Wi-Fi nodes:
    • home_iot_0
    • home_iot_1
    • home_iot_2

Current And Planned Policy

Current policy:

  • full access between home-lan and home-iot-lan;
  • IoT internet access is currently allowed.

Possible future policy:

  • isolate the two networks from each other;
  • cut off the IoT network from the internet.

Dual-Homed Smart Home Server

The smart-home server is present in both networks:

  • 192.168.1.101 on home-lan;
  • 192.168.2.101 on home-iot-lan.

Further details still need to be documented: firewall rules, port forwards, VPN routes, DHCP static mappings, and DNS host overrides.