Router configuration in simple terms - static routing and default route

Domain knowledge :

Lab topology :

Key configuration :

#静态路由配置命令:ip route命令
#      r(config)#ip route dest_net_id  dest_net_mask  next_hop_ip    
#缺省路由配置命令:目的网络id和掩码均为0.0.0.0
#      r(config)#ip route 0.0.0.0      0.0.0.0   next_hop_ip
#配置步骤:
#1. 配置接口:终端接口、网络设备接口
#2. 配置路由器路由协议、静态路由、默认路由
# c2811a的配置
c2811a(config)#interface serial 0/0/1
c2811a(config-if)#ip address 10.1.1.2 255.255.255.0
c2811a(config-if)#no shutdown
c2811a(config-if)#exit
c2811a(config)#interface serial 0/0/2
c2811a(config-if)#ip address 192.168.20.1 255.255.255.0
c2811a(config-if)#no shutdown
c2811a(config-if)#exit
c2811a(config)#interface fa0/1
c2811a(config-if)#ip address 192.168.10.1 255.255.255.0
c2811a(config-if)#no shutdown
c2811a(config-if)#exit
c2811a(config)#ip route 192.168.30.0 255.255.255.0 192.168.20.2 #静态路由
c2811a(config)#ip route 0.0.0.0 0.0.0.0  10.1.1.1   #缺省路由

After the configuration, c2811a routing table:

c 10.1.1.0/24
c 192.168.10.1/24
c 192.168.20.0/24
S 192.168.30.0/24  via  192.168.20.2
S* 0.0.0.0/0  via 10.1.1.1

c2811b two routers 2811 and similar configuration is omitted here, after the configuration:

c2811b routing table

c 192.168.20.0/24
c 192.168.30.0/24
S 192.168.10.0/24 via 192.168.20.1
S* 0.0.0.0/0 via 192.168.20.1

2811 routing table:

c 10.1.1.0/24
S 192.168.10.0/24  10.1.1.2
S 192.168.20.0/24  10.1.1.2
S 192.168.30.0/24  10.1.1.2

Guess you like

Origin www.cnblogs.com/uil2liu/p/11257501.html