功能
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 中增加
      端口
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

 

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