Navigation

    Netgate Discussion Forum
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Release and renew DHCP IP address via Shell

    DHCP and DNS
    1
    1
    119
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      kask last edited by

      Hello,

      How I could completely release and renew IP from my interface via shell, ultimately emulating web UI manual release/new functionality?

      I am running pfSense behind a 4G/5G connection. After my WANs DHCP lease expiration (somewhere under 24h) the internet stops working and pfSense is unable to get a new IP. I can see the queries it tries to make but my ISP is using some weird NAT system; I got my current WAN IP from 100.96.6.136/30 network but my external IP seems to be in whole different level (85.76...). I get my internet connection back online after manually releasing and renewing IP via web UI and I would like to automate this via script & cron.

      I already wrote a script to check for internet connection and issuing a command if it is offline, but I am unable to correctly renew the IP. I'm currently issuing dhclient command, but this does not seem to work. I suspect it asks new IP lease from current 100.96.6.136/30 network. However, if I manually release and renew IP from web UI, I get new lease from totally different network, no where near the same IP pool.

      1 Reply Last reply Reply Quote 0
      • First post
        Last post