一、基础
1、进入 system-view 模式
<Huawei>system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]
2、更改交换机名称
[Huawei]sysname SW-ACC-CORE-1
[SW-ACC-CORE-1]
3、返回 user-view 模式
[SW-ACC-CORE-1]return
<SW-ACC-CORE-1>
4、查看配置
启动配置
<SW-ACC-CORE-1>display saved-configuration
当前配置
<SW-ACC-CORE-1>display current-configuration
5、保存配置
<SW-ACC-CORE-1>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( *.cfg, *.zip ) [vrpcfg.zip]:
Aug 31 2016 09:50:33-08:00 SW-ACC-CORE-1 %%01CFM/4/SAVE(l)[0]:The user chose Y when
deciding whether to save the configuration to the device.
Now saving the current configuration to the slot 0.
Save the configuration successfully.
<SW-ACC-CORE-1>
6、用户和管理
1)配置密码
<SW-ACC-CORE-1>sys
[SW-ACC-CORE-1]aaa
[SW-ACC-CORE-1-aaa]local-user admin password cipher mypass
[SW-ACC-CORE-1-aaa]local-user admin privilege level 3
[SW-ACC-CORE-1-aaa]local-user admin service-type telnet terminal http
[SW-ACC-CORE-1-aaa]quit
[SW-ACC-CORE-1]user-interface vty 0 4
[SW-ACC-CORE-1-ui-vty0-4]authentication-mode aaa
[SW-ACC-CORE-1-ui-vty0-4]quit
测试:
<SW-ACC-BIZ-1>telnet 192.168.200.254
Trying 192.168.200.254 ...
Press CTRL+K to abort
Connected to 192.168.200.254 ...
Login authentication
Username:admin
Password:(输入:mypass)
Info: The max number of VTY users is 5, and the number
of current VTY users on line is 1.
The current login time is 2016-08-31 16:49:07.
<SW-ACC-CORE-1>
5、显示vlan接口信息
[SW-ACC-CORE-1]display ip interface Vlanif 20
Vlanif20 current state : UP
Line protocol current state : UP
The Maximum Transmit Unit : 1500 bytes
input packets : 0, bytes : 0, multicasts : 0
output packets : 0, bytes : 0, multicasts : 0
Directed-broadcast packets:
received packets: 0, sent packets: 0
forwarded packets: 0, dropped packets: 0
Internet Address is 172.30.0.1/18
Broadcast address : 172.30.63.255
TTL being 1 packet number: 0
TTL invalid packet number: 0
ICMP packet input number: 0
Echo reply: 0
Unreachable: 0
Source quench: 0
Routing redirect: 0
Echo request: 0
Router advert: 0
Router solicit: 0
Time exceed: 0
IP header bad: 0
Timestamp request: 0
Timestamp reply: 0
Information request: 0
Information reply: 0
Netmask request: 0
Netmask reply: 0
Unknown type: 0
四、网络
1、显示IP信息
[SW-ACC-CORE-1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
MEth0/0/1 unassigned down down
NULL0 unassigned up up(s)
Vlanif1 10.0.0.1/8 up up
Vlanif20 172.30.0.1/18 up up
Vlanif30 172.30.64.1/18 up up
2、显示路由信息
[SW-ACC-CORE-1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 8 Routes : 8
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/16 Direct 0 0 D 10.0.0.1 Vlanif1
10.0.0.1/32 Direct 0 0 D 127.0.0.1 Vlanif1
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
172.30.0.0/18 Direct 0 0 D 172.30.0.1 Vlanif20
172.30.0.1/32 Direct 0 0 D 127.0.0.1 Vlanif20
172.30.64.0/18 Direct 0 0 D 172.30.64.1 Vlanif30
172.30.64.1/32 Direct 0 0 D 127.0.0.1 Vlanif30
3、ACL
[SW-ACC-CORE-1]acl ?
INTEGER<2000-2999> Basic access-list(add to current using rules)
INTEGER<3000-3999> Advanced access-list(add to current using rules)
INTEGER<4000-4999> Specify a L2 acl group
INTEGER<5000-5999> User defined access-list
ipv6 ACL IPv6
name Specify a named ACL
number Specify a numbered ACL
1)创建
【流规则】
[SW-ACC-CORE-1]acl 3001
[SW-ACC-CORE-1-acl-adv-3001]rule deny ip source 10.50.200.0 0.0.0.255 destination 172.30.0.0 0.0.63.255
[SW-ACC-CORE-1-acl-adv-3001]quit
【流分类】
[SW-ACC-CORE-1]traffic classifier tc1
[SW-ACC-CORE-1-classifier-tc1]if-match acl 3001
[SW-ACC-CORE-1-classifier-tc1]quit
【流行为】默认是permit
[SW-ACC-CORE-1]traffic behavior tb1
[SW-ACC-CORE-1-behavior-tb1]deny
[SW-ACC-CORE-1-behavior-tb1]quit
【流策略】
[SW-ACC-CORE-1]traffic policy tp1
[SW-ACC-CORE-1-trafficpolicy-tp1]classifier tc1 behavior tb1
[SW-ACC-CORE-1-trafficpolicy-tp1]quit