Configuration

EdgeOS 中“set”的補充是什麼?(如何檢查 EdgeRouter 中的值?)

  • September 21, 2017

這個問題討論瞭如何在 EdgeRouter 上執行的 EdgeOS 中設置 gui 和 ssh 監聽地址。我想在進行更改之前檢查我目前的配置,並學習將來檢查其他設置的語法。

鑑於這個例子……

configure
set service gui listen-address 10.0.0.1
set service ssh listen-address 10.0.0.1
commit
save
exit

…在設置它們之前如何檢查這些值?我認為以下內容會起作用……

configure
check service gui listen-address 10.0.0.1
check service ssh listen-address 10.0.0.1
exit

執行help,我看到以下…

root@ubnt# help
GNU bash, version 4.1.0(2)-release (mipsel-unknown-linux-gnu)
These shell commands are defined internally.  Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.

A star (*) next to a name means that the command is disabled.

job_spec [&]                            if COMMANDS; then COMMANDS; [ elif C>
(( expression ))                        kill [-s sigspec | -n signum | -sigs>
. filename [arguments]                  let arg [arg ...]
:                                       local [option] name[=value] ...
[ arg... ]                              logout [n]
[[ expression ]]                        mapfile [-n count] [-O origin] [-s c>
alias [-p] [name[=value] ... ]          popd [-n] [+N | -N]
bind [-lpvsPVS] [-m keymap] [-f filen>  printf [-v var] format [arguments]
break [n]                               pushd [-n] [+N | -N | dir]
builtin [shell-builtin [arg ...]]       pwd [-LP]
caller [expr]                           read [-ers] [-a array] [-d delim] [->
case WORD in [PATTERN [| PATTERN]...)>  readarray [-n count] [-O origin] [-s>
cd [-L|-P] [dir]                        readonly [-af] [name[=value] ...] or>
command [-pVv] command [arg ...]        return [n]
compgen [-abcdefuv] [-o option]  >  select NAME [in WORDS ... ;] do COMM>
complete [-abcdefuv] [-pr] [-DE] >  set [--abefhkmnptuvxBCHP] [-o option>
compopt [-o|+o option] [-DE] [name ..>  shift [n]
continue [n]                            shopt [-pqsu] [-o] [optname ...]
coproc [NAME] command [redirections]    source filename [arguments]
declare [-aAfFilrtux] [-p] [name[=val>  test [expr]
dirs [-clpv] [+N] [-N]                  time [-p] pipeline
echo [-neE] [arg ...]                   times
enable [-a] [-dnps] [-f filename] [na>  trap [-lp] [[arg] signal_spec ...]
eval [arg ...]                          true
exec [-cl] [-a name] [command [argume>  type [-afptP] name [name ...]
exit [n]                                typeset [-aAfFilrtux] [-p] name[=val>
export [-fn] [name[=value] ...] or ex>  ulimit [-SHacdefilmnpqrstuvx] [limit>
false                                   umask [-p] [-S] [mode]
fc [-e ename] [-lnr] [first] [last] o>  unalias [-a] name [name ...]
for NAME [in WORDS ... ] ; do COMMAND>  unset [-f] [-v] [name ...]
for (( exp1; exp2; exp3 )); do COMMAN>  until COMMANDS; do COMMANDS; done
function name { COMMANDS ; } or name >  variables - Names and meanings of so>
getopts optstring name [arg]            wait [pid]
hash [-lr] [-p pathname] [-dt] [name >  while COMMANDS; do COMMANDS; done
help [-dms] [pattern ...]               { COMMANDS ; }
history [-c] [-d offset] [n] or histo>

……然後按下Tab讓我這個……

[edit]
root@ubnt#
comment         copy            load            run
commit          delete          loadkey         save
commit-confirm  discard         merge           set
compare         edit            rename          show
confirm         exit            rollback
[edit]
root@ubnt#

我錯過了什麼?我應該使用show而不是set嗎?(並且用製表符完成我對有問題的變數的訪問?)

您應該使用show,以及更多內容,您可以使用它查看配置部分的完整圖片(或者甚至完整的配置,如果不帶參數發布),而不僅僅是特定值:

admin@maya:~$ configure
[edit]
admin@maya# show service dns
forwarding {
    cache-size 150
    listen-on eth0
    listen-on eth0.10
}
[edit]
admin@maya# show service d
dhcp-server  dns
[edit]
admin@maya# show service dns forwarding cache-size
cache-size 150
[edit]

引用自:https://serverfault.com/questions/874752