Community discussions

MikroTik App
 
amcrs
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Fri Apr 23, 2021 6:46 am

DHCP via script

Sat Apr 24, 2021 9:38 pm

:global eruGuestInterface ERUwlan-guest
:global eruGuestSSID      ERUGuestSSID
:global eruGuestProfile   ERUGuestProfile
:global eruGuestPassword  ERUGuestPassword
:global eruGuestDHCPPool  ERUGuestPool
:global eruGuestDHCPName  ERUGuestDHCP
:global eruGuestDHCPIP    10.10.10.50-10.10.10.99
:global eruGuestDHCPNetwork   10.10.10.0/24

/interface wireless security-profiles
add authentication-types=wpa2-psk eap-methods="" mode=dynamic-keys name=\
    $eruGuestProfile supplicant-identity="" wpa2-pre-shared-key=$eruGuestPassword

/interface wireless
add comment="ERU Guest Virtual Interface" disabled=no keepalive-frames=\
    disabled mac-address=BA:69:F4:F5:53:C2 master-interface=wlan1 \
    multicast-buffering=disabled name=$eruGuestInterface security-profile=$eruGuestProfile \
    ssid=$eruGuestSSID wds-cost-range=0 wds-default-cost=0 wps-mode=disabled

/ip pool
add name=$eruGuestDHCPPool ranges=$eruGuestDHCPIP
/ip dhcp-server
add address-pool=$eruGuestDHCPPool interface=$eruGuestInterface name=$eruGuestDHCPName disabled=yes
If I run this, it created the DHCP Server (greyed out, because it's disabled!). I can then enable it.

But if I make the last line:
/ip dhcp-server
add address-pool=$eruGuestDHCPPool interface=$eruGuestInterface name=$eruGuestDHCPName disabled=no
(where the interface would start as active) the display in Winbox is red. I can disable/enable it, and it stays red.

If I create the same DHCP server from Winbox, with the same values, it starts as disabled, and I can enable it.

Why does creating the DHCP server with disabled=yes break it?
 
amcrs
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Fri Apr 23, 2021 6:46 am

Re: DHCP via script

Sat Apr 24, 2021 9:41 pm

If I run
/ip dhcp-server print, I don't see anything different between running it as the script, or setting it up in the GUI/winbox.
 
amcrs
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Fri Apr 23, 2021 6:46 am

Re: DHCP via script

Sat Apr 24, 2021 10:18 pm

Interesting. If I create it disabled, then enable it from the gui, it works find.

If I create the dhcp server disabled, and then enable it from the command line:
:global tempvar [/ip dhcp-server find name=$eruGuestDHCPName]
/ip dhcp-server enable $tempvar
it comes up red, and disabling/enabling it it will stay red every time it's enabled.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3291
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: DHCP via script

Sat Apr 24, 2021 11:15 pm

You can edit your own post to add more information. Its the pencil symbol (edit post)
 
amcrs
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Fri Apr 23, 2021 6:46 am

Re: DHCP via script

Sat Apr 24, 2021 11:18 pm

You can edit your own post to add more information. Its the pencil symbol (edit post)
Yes, of course. Or I can add additional posts with more information.
 
User avatar
Jotne
Forum Guru
Forum Guru
Posts: 3291
Joined: Sat Dec 24, 2016 11:17 am
Location: Magrathean

Re: DHCP via script

Sun Apr 25, 2021 12:02 am

And also there is a Post Reply button blow the post to reply the post. No need to quote the post above your :)
 
amcrs
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Fri Apr 23, 2021 6:46 am

Re: DHCP via script

Sun Apr 25, 2021 12:06 am

And also there is a Post Reply button blow the post to reply the post. No need to quote the post above your :)
I find it handy to include quoting the reply for clear conversation.

While I appreciate your attempting to train me on how to use use forum, it'd be a lot more useful if your comments also included information regarding my question.
 
amcrs
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Fri Apr 23, 2021 6:46 am

Re: DHCP via script

Sun Apr 25, 2021 12:28 am

But remember when you so, it goes an email to the person you quote, and it fills up the tread with unneeded text.
But I'd hate for you to miss my reply. And the point of that post you refer to is to not reply with a long string of a prior post, and I'm just including enough for context.

People might also find it irritating to be getting a long discourse on how to hit "Reply" which wouldn't make any difference if you were actually addressing the question posted ..........

Because all of THIS is certainly unneeded text......
 
amcrs
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Fri Apr 23, 2021 6:46 am

Re: DHCP via script

Sun Apr 25, 2021 12:39 am

And even more unneeded text since you continue to quote posts, possible you do not get reply to you question.
And I suppose if that's your goal you're just trying to up your post count without actually contributing anything.

Because the long string tied to this post is apparently just you wasting everyone's time. After all, all I did was post the problem, and some additional notes. All the rest is all you. congrats!!!!
 
amcrs
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Fri Apr 23, 2021 6:46 am

Re: DHCP via script

Sun Apr 25, 2021 12:42 am

Once more?
all posts of yours reported.

What an asshole. Is that what I can expect from this forum? I posted an honest question, with details, and all I get is you being a dick.
 
amcrs
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Fri Apr 23, 2021 6:46 am

Re: DHCP via script

Sun Apr 25, 2021 12:43 am

I have not quoted 1 post that not need to be quoted.
Again, you're just a jerk.

Yo also haven't answered one thing about the question posted.
 
amcrs
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Fri Apr 23, 2021 6:46 am

Re: DHCP via script

Sun Apr 25, 2021 12:49 am

I just tried to help you out that you can edit one post to get all information in the post since no one has replayed inn between.,
An I never use negative words about anyone. Just search my post and see trough it.
As you evidence, you can be a jerk just by being harassing and replying with no use.

I didn't need any advice for how to edit posts (I mean really, it's a feature on every forum in the world). Does the forum prohibit me adding more information when I learn more info?

As you your quote advice, it wouldn't be necessary if you'd just answer the question.
 
amcrs
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Fri Apr 23, 2021 6:46 am

Re: DHCP via script

Sun Apr 25, 2021 12:53 am

Have a nice day to you and when some one ask you some you could at list think: He does not like quoting, so I will not do that.
Since you seem so intent on learning, if you don't like getting a email response when people quote you, you can go into your profile and turn that option off.

I'm not quoting long thread of conversation; just enough to clarify what I'm responding to. Which I wouldn't even have to do if you'd actually answer the question.
 
amcrs
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Fri Apr 23, 2021 6:46 am

Re: DHCP via script

Sun Apr 25, 2021 12:54 am

To sysop. Please delete this thread, since it goes no where. Thanks in advance.
Good grief. It goes nowhere because you MADE it go nowhere.
 
amcrs
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 52
Joined: Fri Apr 23, 2021 6:46 am

Re: DHCP via script

Sun Apr 25, 2021 1:00 am

I can turn it of, but like to have there. Same question to you, You can use the big Post Reply below the post.
As I said many posts ago, I like to include at least a snip of the response for context.

Stop bitching about something you can solve that you like. Now you're just harassing me.

A shame you don't actually know enough to provide an actual answer.

Who is online

Users browsing this forum: Google [Bot] and 19 guests