Reply
New Member
Posts: 29
Registered: ‎12-16-2014
Kudos: 15
Solutions: 1

Re: EdgeOS CLI Primer (part 1)

Any plan to make CLI accept partial commands ?

I mean instead "show configuration commands" i could write only "sho conf comm" etc ?

New Member
Posts: 36
Registered: ‎05-27-2014
Kudos: 2

Re: EdgeOS CLI Primer (part 1)

Hmmm maybe tab complete...

Member
Posts: 110
Registered: ‎07-30-2014
Kudos: 22

Re: EdgeOS CLI Primer (part 1)

Hi, I found the GUI works but it seemed like the slower way to configure the Edge Router. CLI, by my reading, appears to be the quicker and feature rich way to work with the router. Is there or could there soon be a updated CLI manual? Right now, I'm picking through the threads locating successful CLI configs. Something like a CLI Primer with tested working examples, CLI common setup examples, and CLI advanced examples with specifics for (VOIP, ...) would be most welcome. In the meantime if someone could point me in the right direction on what links or posts to look at to get up to speed would be most welcome. Thanks for any assistance on this!
Regular Member
Posts: 473
Registered: ‎05-19-2014
Kudos: 91
Solutions: 19

Re: EdgeOS CLI Primer (part 1)


NVSCtech wrote:
Hi, I found the GUI works but it seemed like the slower way to configure the Edge Router. CLI, by my reading, appears to be the quicker and feature rich way to work with the router. Is there or could there soon be a updated CLI manual? Right now, I'm picking through the threads locating successful CLI configs. Something like a CLI Primer with tested working examples, CLI common setup examples, and CLI advanced examples with specifics for (VOIP, ...) would be most welcome. In the meantime if someone could point me in the right direction on what links or posts to look at to get up to speed would be most welcome. Thanks for any assistance on this!

+1

Member
Posts: 263
Registered: ‎08-28-2015
Kudos: 67
Solutions: 11

Re: EdgeOS CLI Primer (part 1)


dulus wrote:

Any plan to make CLI accept partial commands ?

I mean instead "show configuration commands" i could write only "sho conf comm" etc ?


Agreed, Cisco has spoiled me to that degree.

Member
Posts: 110
Registered: ‎07-30-2014
Kudos: 22

Re: EdgeOS CLI Primer (part 1)

In case, here is the short CLI help version:

 

1. Run Putty (it can be installed using Patchmypc) <- to access CLI
2. enter Router IP and choose ssh.
3. Enter the username and pwd
*GUI can be opened at the same time and refreshed to verify settings entered in CLI.*

++ Operational mode vs Configuration mode
First log into CLI in Operational Mode
? -> gives list of commands
cmd ? (ex. show ?) -> gives list of sub-commands (ex. interfaces)
    show interfaces -> runs this command.
    
*QUICK WAY TO enter CMD's in config mode is
1. Create a filename.txt with the cmds on each line.
2. type in:
   configure
   source <path>/your_text_file ex. /tmp/cmds
   *

 

Also, copy and then right-click in CLI interface to paste.  Could someone explain "tab completions"?
    
type *configure* to enter Configuration mode (? & tab completions work in configuration mode)

examples:
configure IP on eth0: set interfaces ethernet eth0 address ? <- would output what is allow here.
    set interfaces ethernet eth0 address 10.1.1.80/23 # working command
    set interfaces ethernet eth0 description "production LAN" # working command
    
    These two commands are in the working config and not yet in the active config
    cmd: *compare* <- Outputs the difference between the working and active config's and shows the complete command change if entered in multiple cmd lines
    cmd: *discard* <- drop a recent edit OR use commit if it is okay to use.
    cmd: *commit* <- as Pickard says, "Make it so!"
    cmd: *commit-confirm* if not confirmed router reboots (useful if using a remote connection)
    changes are active, but a reboot will remove the changes.
    cmd: *top*
    cmd: *save*, makes the changes permanent
    cmd: *save config.boot-something* will save a copy to that name
    cmd: *load config.boot-something*  #will restore that config file >  *commit* to make active > *save; exit* will save it as the config.boot and then exit CLI.
reboot
    cmd: show interfaces <- will show ip assigned to eth0
    cmd: ping 10.1.1.80
    cmd: *exit* <- exit CLI interface
    
++ CLI Rollback
*show system commit* <- shows each commit with a number next to it.
*rollback 4* <- rolls back to this line and drops lines "0-3"

Member
Posts: 263
Registered: ‎08-28-2015
Kudos: 67
Solutions: 11

Re: EdgeOS CLI Primer (part 1)

Back on the cisco-like partial commands: I loaded a VyOS VM the other day and it seems to support that.  Wasn't sure if that's now in EdgeOS 1.7/1.8 or if any cross-platform bits could be taken from their project.

 

+2 because I'm lazy when typing. Man Happy

Regular Member
Posts: 570
Registered: ‎01-06-2012
Kudos: 365
Solutions: 21
Contributions: 2

Re: EdgeOS CLI Primer (part 1)


dulus wrote:

Any plan to make CLI accept partial commands ?

I mean instead "show configuration commands" i could write only "sho conf comm" etc ?


I was spoiled coming from JunOS on a Juniper SRX, where you could type partial commands and it would autocomplete on the spacebar, so "sh<space>int<space>" would become "show interfaces" and so on. While I've not used a Cisco router before, it sounds like that's similar to or the same as what Cisco does. Anyway, I've gotten used to using tab to autocomplete in EdgeOS now, but if this feature came onboard, I'd be eternally grateful.

Member
Posts: 256
Registered: ‎12-12-2015
Kudos: 80
Solutions: 10

Re: EdgeOS CLI Primer (part 1)

[ Edited ]

I'm suprised there is no discussion of rename?  Very handy for some operations and the config tree doesn't seem to handle it properly.

 

brontide@dumont# edit service dhcp-server shared-network-name LAN subnet 192.168.111.0/24                
[edit service dhcp-server shared-network-name LAN subnet 192.168.111.0/24]
brontide@dumont# rename static-mapping android-xxxxxxxxxxxxd2 to static-mapping eric-phone
[edit service dhcp-server shared-network-name LAN subnet 192.168.111.0/24]
brontide@dumont# show                                           
 default-router 192.168.111.1
 dns-server 192.168.111.1
 lease 86400
 start 192.168.111.130 {
     stop 192.168.111.150
 }
 static-mapping Debs-iPod-touch { ... }
 static-mapping Rosebud-1 { ... }
-static-mapping android-xxxxxxxxxxxxd2 {
-    ip-address 192.168.111.39
-    mac-address XX:XX:XX:ad:e7:3f
-}
+static-mapping eric-phone {
+    ip-address 192.168.111.39
+    mac-address XX:XX:XX:ad:e7:3f
+}
 time-server 192.168.111.1
[edit service dhcp-server shared-network-name LAN subnet 192.168.111.0/24]

 

Member
Posts: 256
Registered: ‎12-12-2015
Kudos: 80
Solutions: 10

Re: EdgeOS CLI Primer (part 1)

And another quickie on the copy command.  Useful for duplicating sections of the config.

 

brontide@dumont# edit interfaces ethernet eth2 dhcpv6-pd pd 0
[edit interfaces ethernet eth2 dhcpv6-pd pd 0]
brontide@dumont# copy interface eth0 to interface eth1
[edit interfaces ethernet eth2 dhcpv6-pd pd 0]
brontide@dumont# set interface eth1 prefix-id ff
[edit interfaces ethernet eth2 dhcpv6-pd pd 0]
brontide@dumont# show
 interface eth0 {
     host-address ::1
     prefix-id 0
     service slaac
 }
+interface eth1 {
+    host-address ::1
+    prefix-id ff
+    service slaac
+}
 prefix-length 56
[edit interfaces ethernet eth2 dhcpv6-pd pd 0]
Established Member
Posts: 928
Registered: ‎06-29-2012
Kudos: 448
Solutions: 12

Re: EdgeOS CLI Primer (part 1)

It would be nice if this was put into an online training course on training.ubnt.com. 

Before you begin... Is your solution to throw money at it?
New Member
Posts: 35
Registered: ‎08-16-2014
Kudos: 4

Re: EdgeOS CLI Primer (part 1)

greate idea

+1
Member
Posts: 138
Registered: ‎05-13-2014
Kudos: 30
Solutions: 2

Re: EdgeOS CLI Primer (part 1)

Online Training would be a HUGE plus.

New Member
Posts: 2
Registered: ‎06-20-2016

Re: EdgeOS CLI Primer (part 1)

Hello and thank you for your help by the few realized topics. I am writing from France, but I know that our Canadian cousins ​​encountered the same problem: Francophone community does not find any document in French to configure your devices. This is a real problem. For my part, I have not found any work (book or referential) that allows to learn and understand before speaking here. Would you kind enough to ask around whether Ubiquiti has made a technical book as does, for example Cisco. I translated all of your manual in French (https://dl.ubnt.com/guides/edgemax/EdgeOS_UG.pdf). Small accuracy: France as the Quebec and Canada undertake to make available to any end user a private documentation in the national language. You've never done and that is a shame. For that I remain at your disposal. Now a question: where is EdgeOS CLI Primer (part 2)? I wish you with my thanks, a great day ..
Established Member
Posts: 1,575
Registered: ‎05-03-2016
Kudos: 549
Solutions: 153

Re: EdgeOS CLI Primer (part 1)


yakus wrote:
where is EdgeOS CLI Primer (part 2)?

There is a link to part 2 in the second post of this thread.

New Member
Posts: 6
Registered: ‎10-27-2016

Re: EdgeOS CLI Primer (part 1)

How to show realtime traffic on interface/s ?
Member
Posts: 232
Registered: ‎10-12-2016
Kudos: 56
Solutions: 17

Re: EdgeOS CLI Primer (part 1)

You can run tcpdump using sudo tcpdump -i interface with all the standard tcpdump filtering and capture options.

 

Regards

New Member
Posts: 6
Registered: ‎10-27-2016

Re: EdgeOS CLI Primer (part 1)

I dont't want to see dump traffic at all. I want to see online report interface activity/network traffic.

In junos we may use "monitor" for example,on freebsd/linux i usualiy often  use ifstat/iftop/iptraf

 

traf.png
Senior Member
Posts: 3,859
Registered: ‎05-15-2014
Kudos: 1374
Solutions: 265

Re: EdgeOS CLI Primer (part 1)

You can install these tools via apt-get. Make sure you configure repos first.

New Member
Posts: 7
Registered: ‎12-19-2016
Kudos: 2

Re: EdgeOS CLI Primer (part 1)

Thanks for this UBNT-stig - great info!

 

+1 on a desire for an online training class covering some of this material.  I'd hoped to find something in the videos, but the only training material for the routers appeared to be classroom. Man Sad

Reply