常用模式速查
| 提示符 | 模式 | 進入命令 |
| Router> | 用戶模式 | 默認 |
| Router# | 特權模式 | enable |
| Router(config)# | 全局配置模式 | configure terminal |
| Router(config-if)# | 接口配置模式 | interface <類型/編號> |
| Router(config-line)# | 線路配置模式 | line console 0 / vty 0 4 |
| Router(config-router)# | 路由進程模式 | router rip / ospf 1 |
交換機初始化配置範例
! 主機名
hostname SW-Core
! 特權密碼(加密)
enable secret cisco123
! Console 密碼
line console 0
password cisco
login
! VTY 遠程密碼
line vty 0 15
password cisco
login
! 管理 VLAN IP
interface vlan 1
ip address 192.168.1.5 255.255.255.0
no shutdown
! 默認網關(二層交換機需配置)
ip default-gateway 192.168.1.1
路由器初始化配置範例
hostname R1
enable secret cisco123
line console 0
password cisco
login
line vty 0 4
password cisco
login
interface f0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
interface f0/1
ip address 192.168.10.1 255.255.255.0
no shutdown
! 靜態路由
ip route 192.168.100.0 255.255.255.0 192.168.10.2
! RIP 動態路由
router rip
network 192.168.1.0
network 192.168.10.0
! DHCP 服務器
ip dhcp excluded-address 192.168.1.1
ip dhcp pool LAN_POOL
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 8.8.8.8
常用驗證命令
show running-config ! 當前運行配置
show startup-config ! 啟動配置
show ip route ! 路由表
show ip interface brief ! 接口 IP 狀態
show ip nat translations ! NAT 轉換表