开局
enable
特权模式
configure terminal
全局模式
interface
进接口模式
{e,gi,ti}
hostname
改主机名
line console 0
设置特权密码
enable secret
设置进全局模式密码
line vty 0 ? <1-15> Last Line number
远程端口开启几个
(config-line)#password
远程密码
(config-line)#login
运行
ip default-gateway
默认的网关
ip address 192.168.1.11 255.255.255.0 ip
地址
后面跟掩码
no shutdown
开启
vlan
划分
vlan 2
设置
vlan
vlan 3
(config-vlan)#name 002
改
vlan
名字
(config-if)#switchport access vlan 2
把接口放到
vlan 2
里
(config-if)#switchport mode trunk
把接口设置成中继口
单臂路由
Router(config)#inter fa0/0
Router(config-if)#no shut
Router(config-if)#inter fa0/0.1
Router(config-subif)#encapsulation dot1Q 1
封装
Router(config-subif)#ip address 192.168.0.1 255.255.255.0
NAT
静态:
ip nat inside source static
私有
+
公有
ip nat inside
进口
ip nat outside
出口
动态:
ip nat pool test 202.106.1.5 202.106.1.6 netmask 255.255.255.252
地址池
后面跟掩码
access-list 1 permit 192.168.0.0 0.0.255.255
列表
后面跟的是规则
反掩码
ip nat inside source list 1 pool test
关联起来
PAT
:
ip nat inside source list 1 interface fa0/1 overload
不复用的意思
静态路由:
ip route
后面跟不知道的地址
然后掩码
最后是
对口段的
ip
地址
interface loopback 0
环回口
检查命令:
debug ip icmp
调试命令
debug ip nat
调试
NAt
undebug all
关闭调试
show running-config
查看配置文件
show vlan
查看
vlan
信息
show ip interface brief
查看
ip
配置信息
show mac-address-table
查看
mac
地址
show interface
查看接口
telnet
远程管理
write
保存
duplex {full
全双工
half
半双工
auto
自动协商
}
双工模式
speed
速率
(
10|100|1000|auto
)
表示
为接口配置具体速率值!
本文转自 cs312779641 51CTO博客,原文链接:http://blog.51cto.com/chenhao6/1093105