功能 |
Cisco命令 |
華爲命令 |
進入全局模式 |
#configure terminal |
<Quidway>system |
顯示當前配置 |
show running-config |
display current-configuration |
顯示版本信息 |
show version |
display version |
顯示vlan信息 |
show vlan |
display vlan |
顯示接口信息 |
show interface 接口 |
display interface 接口 |
交換機路由器
命名 |
hostname 主機名 |
sysname 主機名 |
修改特權密碼 |
enable password 密碼(明文)
enable secret 密碼(密文) |
super password 密碼 |
進入接口模式 |
interface 接口 |
interface 接口 |
進入vlan模式 |
interface vlan vlan號 |
interface vlan vlan號 |
給接口配IP |
ip address <ip> <掩碼> |
ip address <ip> <掩碼> |
配telnet密碼 |
line vty 0 4
password 密碼
login |
user-interface vty 0 4
authentication-mode password
set authentication-mode password simple 密碼
user privilege level 3 |
激活端口 |
no shutdown |
undo shutdown |
關閉端口 |
shutdown |
shutdown |
退出 |
exit |
quit |
創建VLAN |
vlan vlan號 |
vlan vlan號 |
VLAN中增加
端口 |
|
port e0/1
port e0/2 to e0/4 |
當前端口加入
到VLAN |
switchport access vlan vlan號 |
port access vlan vlan號 |
設置端口工作
模式 |
switchport mode trunk|access|dynamic |
port link-type trunk|access|hybrid |
設trunk允許的
VLAN |
switchport trunk allowed vlan remove|add ID |
port trunk permit vlan ID|All |
指定鏡像端口 |
monitor session 1 destination int 接口 |
monitor-port 接口 |
指定被鏡像端
口 |
monitor session 1 source int 接口 both |
port mirror 接口 |
設置生成樹啓
動與否 |
spanning-tree vlan vlan號(默認開啓) |
stp enable|disable(默認關閉) |
端口的聚合 |
interface range f0/1 – 4
channel-group 1 mode on |
link-aggregation e0/1 to e0/4 ingress|both
undo link-aggregation e0/1|all |
設置主vlan |
|
isolate-user-vlan enable |
設置主vlan包括
的子vlan |
|
isolate-user-vlan <x> secondary <vlan-list> |
顯示路由信息 |
show ip route |
display ip route |
綁定HDLC協議 |
默認就是 |
link-protocol hdlc |
設靜態路由 |
ip route 網絡號 掩碼 下一跳IP/接口 |
ip route-static網絡號 掩碼 下一跳IP/接口 |
啓用RIP路由 |
router rip |
rip
rip work
rip input
rip output |
配置路由器的
ID |
int loopback 0
ip add IP地址 掩碼 |
router id A.B.C.D |
啓動OSPF協議 |
router ospf 進程號 |
ospf enable |
配置OSPF區域 |
net 網絡號 反向掩碼 area <area_id> |
int 接口
ospf enable area <area_id> |
標準ACL命令格
式 |
access-list 列表號 permit|deny 源IP
反向掩碼 |
acl <acl-number> [match-order config|auto]
rule [normal|special]{permit|deny} [source source-addr source-wildcard|any] |
擴展ACL配置 |
access-list 列表號 permit|deny 協議 源IP 反向掩碼 目的IP 反向掩碼 eq 端口號 |
acl <acl-number> [match-order config|auto]
rule{normal|special}{permit|deny}{tcp|udp}source {<ip wild>|any}destination <ip wild>|any} eq 服務名 |
PPP設置 |
encapsulation ppp |
link-protocol ppp |
Pap 認證 |
主認證方
(config)#username 用戶名 password 密碼
(config)#int 串口接口
(config-if)#ppp authentication pap
被認證方
(config)#int 串口接口
(config-if)#ppp pap sent-username 用戶名 password 密碼
|
主認證方
local-user 用戶名password {simple|cipher} 密碼
interface串口接口
ppp authentication-mode pap
被認證方
interface串口接口
ppp pap local-user 用戶名 password {simple|cipher} 密碼 |
Chap認證 |
主認證方
(config)#username 客戶端主機名 password 密碼
(config)#int 串口接口
(config-if)#ppp authentication
(config-if)#ppp chap hostname 服務器主機名
被認證方
(config)#username 服務器主機名 password 密碼
(config)#int 串口接口
(config-if)#ppp chap hostname 客戶端主機名
|
主認證方
local-user 對方主機名password {simple|cipher} 密碼
interface串口接口
ppp authentication-mode chap
ppp chap user 自己主機名
被認證方
interface串口接口
local-user 對方主機名 password {simple|cipher}密碼
ppp chap user自己主機名 |
靜態nat |
(1)爲內外部接口配IP並激活;
(2)在接口上啓用NAT;
內部接口:ip nat inside
外部接口:ip nat outside
(3)建立靜態地址轉換
(config)#ip nat inside source static 私有IP 公網IP |
interface 接口
nat server global <ip> [port] inside <ip> port [protocol] |
動態NAT |
(1)爲內外部接口配IP並激活;
(2)在接口上啓用NAT;
內部接口:ip nat inside
外部接口:ip nat outside
(3)定義內網允許訪問外網的ACL
(config)#access-list 列表號 permit 源IP 反向掩碼
(4)定義合法IP地址池
(config)#ip nat pool 地址池名 公網起始IP 公網終止IP netmask 掩碼
(5)實現地址轉換
(config)#ip nat inside source list 列表號 pool 地址池名 |
(1) 建立地址池
nat address-group公網起始IP 公網終止IP pool 1
(2)定義內網允許訪問外網的ACL
acl 列表號
rule permit source 源IP 反向掩碼 rule deny source any
(3)實現地址轉換
int 公網接口
nat outbound列表號address-group pool 1
|
|
|
|