Join the Conversation

To sign in, use your existing MySonicWall account. To create a free MySonicWall account click "Register".

SonicOS: DHCP and Command Line Interface - CLI

Hi

I have many static MAC to IP assignments to configure and maintain, about 100.

You can do that through the GUI, like described here:

https://www.sonicwall.com/support/knowledge-base/how-can-i-create-a-static-dhcp-entry-in-the-sonicwall-utm-appliance/170504925446054/

Is there an way to do this with the command line interface CLI? It would really help me. NSA4500 with SonicOS 6.5.3.

Thank you

Bernhard Henning, MPI for Animal Behaviour

Category: Mid Range Firewalls
Reply

Best Answers

Answers

  • config

    dhcp-server

    scope static 10.0.16.50 50:9A:4C:53:49:26

    netmask 255.255.240.0

    default-gateway 10.0.16.6

    comment "some comment"

    commit

    This works! Thank you

    Next step for we would be to wrap my ip-mac list, combined with the above learned CLI commands into one script. I think once I used a bash programm called expect for those kind of duties.

    Have a nice day, Regards Bernhard

    • yes, it was a typo. We have two NSA4600 running.


  • Amazing. Glad I could help. Have a wonderful day!

    Shipra Sahu

    Technical Support Advisor, Premier Services

  • CKHawleyCKHawley Newbie ✭

    Old thread, but super useful!

    Sonicwall Migration Tool online returns corrupt .exp files from some older models (though reports "successful", bricks gen 7 firewalls, frustrating) Had many static DHCP scopes to configure, and CLI was a huge lifesaver!

    Steps- Open old firewall and copy from Lease Scopes screen.

    It gives something like:

    1 Static IP: 192.168.1.113 for MAC aa:bb:cc:dd:ee:ff Unknown Details Edit Delete

    2 Static IP: 192.168.1.114 for MAC aa:bb:cc:dd:ee:ff Unknown Details Edit Delete

    3 Static IP: 192.168.1.119 for MAC aa:bb:cc:dd:ee:ff

    Massage (find/replace, I used Notepad++) the various lines into format:

    scope static 192.168.1.119 aa:bb:cc:dd:ee:ff

    netmask 255.255.255.0

    name "Toshiba Color"

    commit

    exit


    scope static 192.168.1.139 aa:bb:cc:dd:ee:ff

    netmask 255.255.255.0

    name "HP Build Station"

    commit

    exit


    scope static 192.168.1.141 aa:bb:cc:dd:ee:ff

    netmask 255.255.255.0

    name "MagicJack"

    commit

    exit


    Follow directions previously given, and all will flow into place in a single shot. Saved me MANY HOURS of mistyping MAC and IP addresses!

    All of mine are target devices, so didn't bother with DNS, Gateways, etc, on most, but those, along with Comments and plenty of other options can be set in the same manner.

Sign In or Register to comment.