华为HCIA-静态路由配置

image

使用命令

# 查看路由器当前配置信息
dis cu
display current-configuration

# 查看路由表
dis ip routing-table
dis ip routing-table 192.168.3.0

# 配置静态路由
ip route-static 192.168.3.0 24 23.1.1.3

# 配置默认路由
ip route-static 0.0.0.0 0 23.1.1.3

# 查看带ip的端口信息
dis ip int br

R1配置

#
interface GigabitEthernet0/0/0
 ip address 12.1.1.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 192.168.1.1 255.255.255.0 
#
ip route-static 12.1.1.0 255.255.255.0 12.1.1.2
ip route-static 23.1.1.0 255.255.255.0 12.1.1.2
ip route-static 192.168.2.0 255.255.255.0 12.1.1.2
ip route-static 192.168.3.0 255.255.255.0 12.1.1.2
#

R2配置

#
interface GigabitEthernet0/0/0
 ip address 12.1.1.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 23.1.1.2 255.255.255.0 
#
interface GigabitEthernet0/0/2
 ip address 192.168.2.1 255.255.255.0 
#
interface NULL0
#
ip route-static 192.168.1.0 255.255.255.0 12.1.1.1
ip route-static 192.168.3.0 255.255.255.0 23.1.1.3
#

R3配置

#
interface GigabitEthernet0/0/0
 ip address 23.1.1.3 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 192.168.3.1 255.255.255.0 
#
interface GigabitEthernet0/0/2
#
interface NULL0
#
ip route-static 192.168.1.0 255.255.255.0 23.1.1.2
ip route-static 192.168.2.0 255.255.255.0 23.1.1.2
#
posted @ 2022-04-30 17:29  xl4ng  阅读(352)  评论(0编辑  收藏  举报