Ubiquiti – EdgeRouter – Cách cấu hình giao diện configure an interface
Overview
Readers will learn how to configure a router interface. This is composed of two parts:
- Assign an IP address and subnet mask
- Enter a description
Steps
Use the set, compare, commit, and save commands.
To configure an interface, use the set command:
ubnt@ubnt:~$ configure [edit]
To view the possible completions for the eth0 address, enter set interfaces ethernet eth0 address and press the ? key.
ubnt@ubnt# set interfaces ethernet eth0 address
Possible completions:
IP address and prefix length
IPv6 address and prefix length
dhcp Dynamic Host Configuration Protocol
dhcpv6 Dynamic Host Configuration Protocol for IPv6
[edit]
ubnt@ubnt# set interfaces ethernet eth0 address 10.1.1.80/23
[edit]
ubnt@ubnt# set interfaces ethernet eth0 description "production LAN"
[edit]
These changes affect the working configuration, not the active configuration. To see what changes have been made to the working configuration, use the compare command:
ubnt@ubnt# compare [edit interfaces ethernet eth0] +address 10.1.1.2/24 +description "production LAN" [edit]
To make the changes active, use the commit command:
ubnt@ubnt# commit [edit]
If you reboot the EdgeRouter, the changes will be lost. To save these changes, use the save command to save the active configuration to the boot configuration.
ubnt@ubnt# save
Saving configuration to '/config/config.boot'...
Done
[edit]
ubnt@ubnt# exit
exit
ubnt@ubnt:~$
ubnt@ubnt:~$ show interfaces
Codes: S - State, L - Link, u - Up, D - Down, A - Admin Down
Interface IP Address S/L Description
--------- ---------- --- -----------
eth0 10.1.1.80/23 u/u production LAN
eth1 - u/D
eth2 - u/D
eth3 - u/D
eth4 - u/D
eth5 - u/D
eth6 - u/D
lo 127.0.0.1/8 u/u
::1/128
ubnt@ubnt:~$ ping 10.1.0.1
PING 10.1.0.1 (10.1.0.1) 56(84) bytes of data.
64 bytes from 10.1.0.1: icmp_req=1 ttl=64 time=0.460 ms
64 bytes from 10.1.0.1: icmp_req=2 ttl=64 time=0.407 ms
^C
--- 10.1.0.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.407/0.433/0.460/0.033 ms