CLI 模式導航
| 提示符 | 模式 | 用途 |
| Router> | 用戶模式 | 查看基本信息 |
| Router# | 特權模式 | 查看/修改運行配置、保存 |
| Router(config)# | 全局配置模式 | 全局參數設置 |
| Router(config-if)# | 接口配置模式 | 接口 IP、封裝、帶寬等 |
| Router(config-line)# | 線路配置模式 | Console/VTY 密碼、超時 |
| Router(config-router)# | 路由進程模式 | 動態路由協議配置 |
核心配置任務速查
1. 接口 IP 配置
en
conf t
interface f0/0
ip address 192.168.1.1 255.255.255.0
no shutdown
exit
2. 靜態路由
ip route 192.168.100.0 255.255.255.0 192.168.10.2
! 目標網段 掩碼 下一跳IP
show ip route ! 查看,S 開頭為靜態路由
3. RIP 動態路由
router rip
version 2
network 192.168.1.0
network 192.168.10.0
! network 參數為直連網段(類網絡),RIPv2 支持 VLSM
4. 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
! 排除網關 IP,定義地址池、默認網關、DNS
5. NAT 配置(PAT/過載模式)
interface f0/0
ip nat inside
interface f0/1
ip nat outside
access-list 1 permit 192.168.1.0 0.0.0.255
ip nat inside source list 1 interface f0/1 overload
! 內網源地址轉換為外網接口 IP,端口多路復用
6. 保存配置
copy running-config startup-config
! 或簡寫:wr