Bug #12632
openAssigning a /30 WAN IP address at the console does not save the gateway correctly
0%
Description
First encoutnered two months ago. Assumed I had done a typo or something and moved on. Now notice this can be reproduced every time on all installs I have tried:
ISP / Colo assign an IPv4 /30 203.0.113.156/30
Hardware has two NICs. bxe0 and bxe1. bxe0 is WAN bxe1 has no link.
- Install pfSense 2.5.2
- Assign bxe0 as WAN via console menu option 1
- Do not assign bxe1 as anything.
- Assign WAN IP manually via console menu option 2
- Specify: WAN IP 203.0.113.158, Netmask 30, Gateway 203.0.113.157
Expected behavior: Default route should be set with gateway as 203.0.113.157
Actual behavior: Gateway revers to 203.0.113.158, networking becomes impossible
Workaround:
- route del default
- route add default 203.0.113.157
- Enter web configurator
- Notice here during the WAN configuration step in web configurator it does indeed show gateway incorrectly as 203.0.113.158
- Fix gateway in web configurator
- Apply
Only ever seen this when WAN is a /30 - /22 /23/24 etc do not do this.
Files
Updated by Viktor Gurov 5 months ago
- Status changed from New to Feedback
- Affected Version set to 2.5.2
Unable to reproduce:
Available interfaces: 1 - WAN (vtnet1 - dhcp, dhcp6) 2 - LAN (vtnet0 - static) 3 - OPT1 (vtnet2 - static, staticv6) Enter the number of the interface you wish to configure: 1 Configure IPv4 address WAN interface via DHCP? (y/n) n Enter the new WAN IPv4 address. Press <ENTER> for none: > 203.0.113.158 Subnet masks are entered as bit counts (as in CIDR notation) in pfSense. e.g. 255.255.255.0 = 24 255.255.0.0 = 16 255.0.0.0 = 8 Enter the new WAN IPv4 subnet bit count (1 to 31): > 30 For a WAN, enter the new WAN IPv4 upstream gateway address. For a LAN, press <ENTER> for none: > 203.0.113.157
result:
# route -4n get default route to: 0.0.0.0 destination: 0.0.0.0 mask: 0.0.0.0 gateway: 203.0.113.157 fib: 0 interface: vtnet1 flags: <UP,GATEWAY,DONE,STATIC> recvpipe sendpipe ssthresh rtt,msec mtu weight expire 0 0 0 0 1500 1 0
Updated by Viktor Gurov 5 months ago
seems to be fixed in #11581
please test on the latest development snapshot
Updated by Danilo Zrenjanin 5 months ago
- File clipboard-202112311307-sidpz.png clipboard-202112311307-sidpz.png added
- Status changed from Feedback to Resolved
Tested against:
2.6.0-BETA (amd64) built on Thu Dec 30 06:16:46 UTC 2021 FreeBSD 12.3-STABLE
It works as expected. I am marking this ticket resolved.
Updated by Danilo Zrenjanin 5 months ago
- Status changed from Resolved to Feedback
- Priority changed from Normal to High
Updated by Danilo Zrenjanin 5 months ago
I tested again, against the same version:
2.6.0-BETA (amd64) built on Thu Dec 30 06:16:46 UTC 2021 FreeBSD 12.3-STABLE
This time I didn't have the default gateway in the routing table after setting WAN IP 203.0.113.158, Netmask 30, Gateway 203.0.113.157 from the console.
It's strange it doesn't fail every time.
Needs more testing.
Available interfaces: 1 - WAN (vtnet0 - dhcp) 2 - LAN (vtnet1.20 - static) Enter the number of the interface you wish to configure: 1 Configure IPv4 address WAN interface via DHCP? (y/n) n Enter the new WAN IPv4 address. Press <ENTER> for none: > 203.0.113.158 Subnet masks are entered as bit counts (as in CIDR notation) in pfSense. e.g. 255.255.255.0 = 24 255.255.0.0 = 16 255.0.0.0 = 8 Enter the new WAN IPv4 subnet bit count (1 to 32): > 30 For a WAN, enter the new WAN IPv4 upstream gateway address. For a LAN, press <ENTER> for none: > 203.0.113.157 Configure IPv6 address WAN interface via DHCP6? (y/n) n Enter the new WAN IPv6 address. Press <ENTER> for none: > Disabling IPv4 DHCPD... Disabling IPv6 DHCPD... Do you want to revert to HTTP as the webConfigurator protocol? (y/n) n Please wait while the changes are saved to WAN... Reloading filter... Reloading routing configuration...route: writing to routing socket: Network is unreachable DHCPD... The IPv4 WAN address has been set to 203.0.113.158/30 Press <ENTER> to continue.
[2.6.0-BETA][admin@pfSense.home.arpa]/root: route -n get default route: route has not been found
[2.6.0-BETA][admin@pfSense.home.arpa]/root: netstat -rn Routing tables Internet: Destination Gateway Flags Netif Expire 127.0.0.1 link#4 UH lo0 192.168.20.0/24 link#7 U vtnet1.2 192.168.20.2 link#7 UHS lo0 203.0.113.156/30 link#1 U vtnet0 203.0.113.158 link#1 UHS lo0
Updated by Danilo Zrenjanin 4 months ago
I replicated the issue on 22.01.r.20220124.1828 and 2.6.0.r.20220124.1828.
Available interfaces: 1 - WAN (lagg0.4090 - dhcp) 2 - LAN (lagg0.4091 - static) 3 - OPT1 (ix0) 4 - OPT2 (ix1) Enter the number of the interface you wish to configure: 1 Configure IPv4 address WAN interface via DHCP? (y/n) n Enter the new WAN IPv4 address. Press <ENTER> for none: > 203.0.113.158 Subnet masks are entered as bit counts (as in CIDR notation) in Netgate pfSense Plus. e.g. 255.255.255.0 = 24 255.255.0.0 = 16 255.0.0.0 = 8 Enter the new WAN IPv4 subnet bit count (1 to 32): > 30 For a WAN, enter the new WAN IPv4 upstream gateway address. For a LAN, press <ENTER> for none: > 203.0.113.157 Configure IPv6 address WAN interface via DHCP6? (y/n) n Enter the new WAN IPv6 address. Press <ENTER> for none: > Disabling IPv4 DHCPD... Disabling IPv6 DHCPD... Do you want to revert to HTTP as the webConfigurator protocol? (y/n) n Please wait while the changes are saved to WAN... Reloading filter... Reloading routing configuration...route: writing to routing socket: Network is unreachable DHCPD... The IPv4 WAN address has been set to 203.0.113.158/30 Press <ENTER> to continue.
netstat -rn Routing tables Internet: Destination Gateway Flags Netif Expire 127.0.0.1 link#16 UH lo0 192.168.1.0/24 link#21 U lagg0.40 192.168.1.1 link#21 UHS lo0 203.0.113.156/30 link#20 U lagg0.40 203.0.113.158 link#20 UHS lo0
It looks like it fails to write the default gateway if it is not reachable when defining it from the console.
Updated by Jim Pingle 4 months ago
- Subject changed from 2.5.2 New installs, when assigning WAN IP from a /30 gateway is saved incorrectly. to Assigning a /30 WAN IP address at the console does not save the gateway correctly
- Status changed from Feedback to New
- Target version set to 2.7.0
- Plus Target Version set to 22.05
Updated by Jim Pingle 5 days ago
- Plus Target Version changed from 22.05 to 22.09