Bug #16144
openSwitching from Static IP block to DHCP on the WAN leaves original routes in place
0%
Description
I had a /29 Static IP block and gave it up (changing ISP in the process) and switched the WAN to DHCP. I used option 2 in the console to do this. I could get on line eventually but had some issues. I looked at the routing table and found the original routes and default gateway were still set, plus my new IP address and gateway (but not default). This was the IPv4 routing table at the time:
```
Routing tables
Internet:
Destination Gateway Flags Nhop# Mtu Netif Expire
default 62.30.63.89 UGS 5 1500 igc0
62.30.63.88/29 link#1 U 8 1500 igc0
62.30.63.93 link#6 UHS 3 16384 lo0
82.5.76.0/22 link#1 U 1 1500 igc0
aaa.bb.76.1 link#1 UHS 4 1500 igc0
aa.bb.79.245 link#6 UHS 3 16384 lo0
127.0.0.1 link#6 UH 2 16384 lo0
127.0.0.2 link#6 UH 7 16384 lo0
172.17.0.0/23 172.17.2.1 UGS 10 1500 bridge0
172.17.2.0/24 link#9 U 6 1500 bridge0
172.17.2.254 link#6 UHS 9 16384 lo0
```
And the output of `ifconfig igc0`:
```
igc0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500
description: WAN
options=4e020bb<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,JUMBO_MTU,VLAN_HWCSUM,WOL_MAGIC,RXCSUM_IPV6,TXCSUM_IPV6,HWSTATS,MEXTPG>
ether 88:04:5b:51:6d:64
inet aa.bb.79.245 netmask 0xfffffc00 broadcast aa.bb.79.255
inet 62.30.63.93 netmask 0xfffffff8 broadcast 62.30.63.95
inet6 fe80::8a04:5bff:fe51:6d64%igc0 prefixlen 64 scopeid 0x1
media: Ethernet autoselect (2500Base-T <full-duplex>)
status: active
nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
```
Prior to and after switching to DHCP I had tried clearing all the Virtual IPs but failed as one was always flagged as in use and needed for routing which was what pointed me to the routing table.
The routing table was set up as a result of using option 2, setting the WAN to static, so setting it to DHCP should clear all the static settings, or, at a very minimum throw a warning that you will need to do this manually afterwards. All domestic routers I have come across always change their routing tables and gateways when the connection type is reconfigured. IMHO pfSense should do the same.
There was a forum thread about this at https://forum.netgate.com/topic/197168/problems-switching-from-static-ip-block-to-dhcp-on-the-wan?lang=en-GB
No data to display