前言
网络拓扑
配置
no ena configure terminal interface GigabitEthernet0/0 interface FastEthernet1/0 interface FastEthernet0/0 interface Serial2/0 interface Serial2/0 no shutdown #打开端口 ip address 192.168.10.1 255.255.255.0 #配置端口地址 ip address 192.168.20.1 255.255.255.0 #配置端口地址 ip address 192.168.3.1 255.255.255.0 #配置端口地址 ip address 192.168.3.2 255.255.255.0 #配置端口地址 show ip route brief #查看路由 do show ip interface brief #查看接口地址 #添加路由目的地址和下一跳 ip route 192.168.1.0 255.255.255.0 192.168.3.2 ip route 192.168.10.0 255.255.255.0 192.168.3.1 P1 配置IP地址 192.168.1.2 255.255.255.0 192.168.1.1 R1 interface FastEthernet0/0 interface GigabitEthernet0/0 ip address 192.168.1.1 255.255.255.0 interface Serial2/0:12.1.1.1 ip address 12.1.1.1 255.255.255.0 配置默认静态路由 ip route 0.0.0.0 0.0.0.0 12.1.1.2 运营商R interface Serial2/0 ip address 12.1.1.2 255.255.255.0 interface Serial3/0 ip address 23.1.1.2 255.255.255.0 ip route 0.0.0.0 0.0.0.0 23.1.1.2 ip route 0.0.0.0 0.0.0.0 23.1.1.3 Router(config)#ip route 12.1.1.0 255.255.255.0 23.1.1.3 Router(config)#ip route 23.1.1.0 255.255.255.0 12.1.1.1 PC通 ip route 192.168.1.0 255.255.255.0 12.1.1.1 ip route 10.1.1.0 255.255.255.0 23.1.1.3 PC不通 Router(config)#ip route 12.1.1.0 255.255.255.0 23.1.1.3 Router(config)#ip route 23.1.1.0 255.255.255.0 12.1.1.1 Jinqing666 #直连是通的 不直连需要路由 R2 interface Serial2/0 ip address 23.1.1.3 255.255.255.0 ip route 0.0.0.0 0.0.0.0 23.1.1.2 interface FastEthernet0/0 ip address 10.1.1.1 255.255.255.0 P2 配置IP地址 10.1.1.2 255.0.0.0 10.1.1.1 do show ip interface brief interface Tunnel0 no interface Tunnel0 ip address 172.26.1.1 255.255.255.0 tunnel source Gig0/1 tunnel destination 23.1.1.3 interface Tunnel0 no interface Tunnel0 ip address 172.26.1.2 255.255.255.0 tunnel source Gig0/1 tunnel destination 12.1.1.1 添加终端到tunnel路由 ip route 目标网段 目标网段掩码 下一条 分布R1:ip route 10.1.1.0 255.255.255.0 172.26.1.2 总部R2:ip route 192.168.1.0 255.255.255.0 172.26.1.1
标签:隧道,ip,route,255.255,GRE,0.0,interface,255.0 From: https://www.cnblogs.com/sss4/p/18185876