Edgerouter command line help

I’m trying to up my game in the command line. At the moment I am attempting to set up a DHCP server on an ER-4. Below are the commands that I am issuing via putty.

When I paste it into the terminal I get an error that states "The specified configuration node is not valid.

I grabbed these straight from ubiquiti’s website and haven’t really been able to find any other information about it.

configure
Set service DHCP-server disabled false
Set service DHCP-server shared-network-name LAN1 authoritative enable
Set service DHCP-server shared-network-name LAN1 subnet 192.168.50.0/24 default-router 192.168.50.1
Set service DHCP-server shared-network-name LAN1 subnet 192.168.50.0/24 DNS-server 192.168.50.1
Set service DHCP-server shared-network-name LAN1 subnet 192.168.50.0/24 Lease 86400
Set service DHCP-server shared-network-name LAN1 subnet 192.168.50.0/24 start 192.168.50.100 stop 192.168.50.240
commit
save

When I paste it into the terminal I get an error that states "The

Wow the formatting is horrible.

attempting to fix now

Wrap it in ``` (triple backticks)

1 Like

See if it works if you don’t paste it all as one block. Specifically, the configure command might need to run before you paste the rest of that in.

Also, if you want to run configure commands in a script, you can do so by prefixing them with this: /opt/vyatta/sbin/vyatta-cfg-cmd-wrapper

Figure I’d throw that in because it’s not well documented.

1 Like

I’ve noticed the ER-4 fact sheet (PDF <-link) from Ubiquity says there’s a GUI, have you tried that?

I also came across the EdgeOS User Guide here: PDF, perhaps it’ll get you further?

1 Like

I HAVE BEEN TRYING TO FIGURE OUT HOW THAT WORKS !!!

THANK YOU LOL
feel like such a newb

1 Like

I have tried it all as one block. and also have tried running the Configure and then line by line.

Still doesn’t want to work right for some reason…

what happens if you only type configure?

1 Like

I am able to run that without issues. When I do it adds an
[edit] the line about the ubnt@edgerouter-4. Looks like below.

ubnt@edgerouter-4:
ubnt@edgerouter-4:configure
(edit)
ubnt@edgerouter-4:

I was able to set up some basic firewall rules and they worked putting the whole block in at once and it starts of with the
configure
on the first line

@Dutch_Master I am able to set it up via the GUI with no problem. just trying to expand my skills.

1 Like

Can you go through the commands one by one and see which one is producing the error?

1 Like

I am getting it on every line.

I checked the GUI and there are no DHCP server configured,

I would think that the first line

Set service DHCP-server disabled false

would add in a new DHCP server. But maybe that is the issue where it is trying to make edits to something that does not exist.

I noticed prior that when I tried to run the
configure
I typed in a capital c Configure. When I did that I received the error the command not found. But when it is lowercase I was able to enter it with no issue.

Yeah, it’s case sensitive, so if you are literally typing:

Then that will not work. There is tab completion also, so you can use that to see what the commands are.

2 Likes

you cannot even imagine my level of frustration right now…

:facepalm: :facepalm: :facepalm: :facepalm: :facepalm: :facepalm:

Yea I was literally typing in like that.

Just went through and did it all with lowercase and had no problems. Verified via the GUI.

2 Likes

Well, you’ve just learned something new :rofl:

3 Likes

Sure did.

@oO.o Since fixing the capitalization issues I am also able to run it in one chunk Thanks for your help I appreciate it !!

@TheCakeIsNaOH Also thank you again for telling me how to add in code to posts.

2 Likes

Just a friendly reminder that most of your networking gear runs a unix-like OS, so case sensitivity is always something to pay attention to.

1 Like

Yea. I think what did me in was I pre-typed it all up in a .txt file. Then force of habit I capitalize things like DHCP and DNS. Were not even gonna talk about why I put in a capital L in lease.

I think my pinkie just likes to hit the shift key on me at random lol.

1 Like

decided that I would add in some more to this thread rather than open a new one.

If I need to change the category just let me know,

Working on adding in static routes at the moment,
Was able to add in a static route successfully using the below

set protocols static route 172.41.25.0/24 next-hop 192.168.66.1 description 
set protocols static route 172.41.25.0/24 next-hop 192.168.66.1 distance 1
commit ; save

How would I go about adding it in to use an interface instead of a gateway.
Spent lots of time googling and have not been able to come up with anything.