Ubiquiti EdgeRouter [52/57] Create a firewall rule

Ubiquiti EdgeRouter [52/57] Create a firewall rule
49
Appendix A: Command Line InterfaceEdgeOS
User Guide
Ubiquiti Networks, Inc.
Remove the Default User Account
To remove the default user account, do the following:
Create a new user
Log out of the default user account
Log in with the new user account
Delete the default user account
Use the set, commit, save, exit, and delete commands.
ubnt@ubnt:~$ configure
[edit]
ubnt@ubnt:# set system login user admin1 authentication
plaintext-password admin1pass
[edit]
ubnt@ubnt:# commit
[edit]
ubnt@ubnt:# save
Saving configuration to ‘/config/config.boot’...
Done
[edit]
ubnt@ubnt:# exit
exit
ubnt@ubnt:~$ exit
logout
Welcome to Edge OS ubnt ttyS0
ubnt login: admin1
Password:
Linux ubnt 2.6.32.13-UBNT #1 SMP Fri Jun 8 09:48:31 PDT
2012 mips64
Welcome to EdgeOS
admin1@ubnt:~$ configure
[edit]
admin1@ubnt# delete system login user ubnt
[edit]
admin1@ubnt# commit
[edit]
admin1@ubnt# save
Saving configuration to ‘/config/config.boot’...
Done
[edit]
admin@ubnt# exit
exit
admin1@ubnt:~$
The plaintext password that you entered is converted to
an encrypted password.
admin1@ubnt:~$ configure
[edit]
admin1@ubnt# show system login
user admin1 {
authentication {
encrypted-password
$1$mv8ERQ1T$7xq/eUDwy/5And7nV.9r6.
plaintext-password
““
}
}
[edit]
admin1@ubnt# exit
exit
admin1@ubnt:~$
Create a Firewall Rule
To create a firewall rule, use the set or edit commands
(both methods are described below). In addition, use the
compare, discard, up, top, copy, and rename commands.
Create a firewall rule using the full syntax:
ubnt@ubnt:~$ configure
[edit]
ubnt@ubnt# set firewall name TEST default-action drop
[edit]
ubnt@ubnt# set firewall name TEST enable-default-log
[edit]
ubnt@ubnt# set firewall name TEST rule 10 description
“allow icmp”
[edit]
ubnt@ubnt# set firewall name TEST rule 10 action accept
[edit]
ubnt@ubnt# set firewall name TEST rule 10 protocol icmp
[edit]
To display uncommitted changes, use the compare
command:
ubnt@ubnt# compare
[edit firewall]
+name TEST {
+ default-action drop
+ enable-default-log
+ rule 10 {
+ action accept
+ description “allow icmp”
+ protocol icmp
+ }
+}
[edit]
To undo uncommitted changes, use the discard
command:
ubnt@ubnt# discard
Changes have been discarded
[edit]
ubnt@ubnt# compare
No changes between working and active configurations
[edit]
To create the same firewall rule while reducing the amount
of repetition in the full syntax, use the edit command:
ubnt@ubnt# edit firewall name TEST
[edit firewall name TEST]
ubnt@ubnt#set default-action drop
[edit firewall name TEST]
ubnt@ubnt# set enable-default-log
[edit firewall name TEST]
ubnt@ubnt#edit rule 10
[edit firewall name TEST rule 10]

Содержание

Похожие устройства

Скачать