How to automatically re-run DHCP when a USB-ethernet interface is plugged in



  • Hi.

    The WAN-side interface is a USB-ethernet stick. It gets an IP by DHCP when booting up. But if it is unplugged while running and then plugged back in, the pfsense DHCP client does not automatically give it an IP. Unlike linux distros where plugging such an interface would automatically kick the DHCP client to obtain an IP etc.

    How would you facilitate this linux functionality to automatically make the DHCP client get an IP as soon as such an interface is plugged in?



  • problem #1
    @Ulysses_:

    The WAN-side interface is a USB-ethernet stick.

    do yourself a favour and get a good nic

    @Ulysses_:

    It gets an IP by DHCP when booting up. But if it is unplugged while running and then plugged back in, the pfsense DHCP client does not automatically give it an IP. Unlike linux distros where plugging such an interface would automatically kick the DHCP client to obtain an IP etc.

    How would you facilitate this linux functionality to automatically make the DHCP client get an IP as soon as such an interface is plugged in?

    no clue. i'm pretty sure pfSense isn't tested for this scenario, because nobody wants/needs to unplug interfaces on a running router…..



  • Thanks but actually the use of such a nic is intentional (pfsense runs in a VM and only pfsense sees this WAN-side nic, the host's regular nic has no cable attached and the host has no drivers for the usb-ethernet nic installed at all, the purpose of this being that only VM's can ever see the internet and get infected or owned).

    Is there any support for running scripts periodically or when an nic module is added?



  • Just noticed the same problem occurs with any nic when the router it is connected to is rebooted: pfsense's DHCP client does not get periodically called to obtain an IP.