Good morning,
I believe I've found a bug in the PBR engine. The scenario is the following:
- DHCP addresses on whichever is the WAN port.
- A VPN or other vTunnel interface
- Attempting to *exclude* certain addresses in the LAN subnet from routing over the vTunnel using source IP.
Expected behavior: Addreses excluded from the tunnel go out WAN interface.
Actual behavior: Traffic from addresses excluded from the tunnel never reaches the WAN interface, period, regardless of whether or not the tunnel is established.
I have posted on forums here and reddit.com/r/ubiquiti for assistance, and I've sent an ticket for assistance to UBNT. Nobody seems to be able to solve the issue; and my config 'should work'. As it doesn't, either I've made an error nobody's yet found, or there's a bug in the routing engine, and a serious one that would impact business use.
Thank you for reading; sanitized config follows (In this config, the address excluded is 192.168.17.37/32):
Please see https://community.ubnt.com/t5/EdgeMAX/ERL-Excluding-certain-source-IPs-from-routing-through-OpenVPN/m-p/1708237#U1708237 for reference
firewall { all-ping enable broadcast-ping disable ipv6-receive-redirects disable ipv6-src-route disable ip-src-route enable log-martians enable modify SOURCE_ROUTE { rule 10 { action modify description "Excluded from VPN routing" modify { table 1 } source { address 192.168.17.37/32 } } rule 20 { action modify modify { table 2 } source { address 192.168.17.0/24 } } } name WAN_IN { default-action drop description "WAN to internal" rule 10 { action accept description "Allow established/related" state { established enable related enable } } rule 20 { action drop description "Drop invalid state" state { invalid enable } } } name WAN_LOCAL { default-action drop description "WAN to router" rule 10 { action accept description "Allow established/related" state { established enable related enable } } rule 20 { action accept description "Allow GRE" log disable protocol 47 state { established enable invalid disable new enable related enable } } rule 30 { action accept description "Allow PPTP" destination { port 1723 } log disable protocol tcp } rule 40 { action drop description "Drop invalid state" state { invalid enable } } } receive-redirects disable send-redirects enable source-validation disable syn-cookies enable } interfaces { ethernet eth0 { address 192.168.17.1/24 description Local duplex auto firewall { in { modify SOURCE_ROUTE } } speed auto } ethernet eth1 { address dhcp description Internet duplex auto firewall { in { name WAN_IN } local { name WAN_LOCAL } } speed auto } ethernet eth2 { address 192.168.2.1/24 description "Local 2" duplex auto speed auto } loopback lo { } openvpn vtun0 { config-file /config/auth/USSiliconValley.ovpn disable } } protocols { static { table 1 { interface-route 0.0.0.0/0 { next-hop-interface eth1 { } } } table 2 { interface-route 0.0.0.0/0 { next-hop-interface vtun0 { } } } } } service { dhcp-server { disabled false hostfile-update disable shared-network-name **REDACTED**{ authoritative disable subnet 192.168.17.0/24 { default-router 192.168.17.1 dns-server **REDACTED** lease 86400 start 192.168.17.100 { stop 192.168.17.200 } unifi-controller **REDACTED** } } use-dnsmasq disable } dns { dynamic { interface eth1 { service afraid { host-name **REDACTED** login **REDACTED** password **REDACTED** protocol **REDACTED** server **REDACTED** } } } } gui { http-port 80 https-port 443 older-ciphers enable } nat { rule 5000 { description "Routing Excluded from VPN" log disable outbound-interface eth1 protocol all type masquerade } rule 5001 { description "PIA Masquerade NAT" log disable outbound-interface vtun0 protocol all source { } type masquerade } } ssh { port 22 protocol-version v2 } } system { domain-name **REDACTED** host-name **REDACTED** login { user **REDACTED** { authentication { encrypted-password **REDACTED** plaintext-password "" } full-name "**REDACTED**" level admin } } name-server **REDACTED** ntp { server 0.ubnt.pool.ntp.org { } server 1.ubnt.pool.ntp.org { } server 2.ubnt.pool.ntp.org { } server 3.ubnt.pool.ntp.org { } } syslog { global { facility all { level notice } facility protocols { level debug } } } time-zone America/Los_Angeles } /* Warning: Do not remove the following line. */ /* === vyatta-config-version: "config-management@1:conntrack@1:cron@1:dhcp-relay@1:dhcp-server@4:firewall@5:ipsec@5:nat@3:qos@1:quagga@2:system@4:ubnt-pptp@1:ubnt-util@1:vrrp@1:webgui@1:webproxy@1:zone-policy@1" === */ /* Release version: v1.9.0.4901118.160804.1131 */