我有以下设置:

左边的路由器是一个棍子上的路由器,用于在具有不同VLAN的LAN内路由stream量。
左边的交换机是我们LAN的根交换机,可以作为VTP服务器。 这也连接到路由器6。
这是我想要做的:
我想用这四台路由器将这个局域网连接到一个未来的其他局域网(这个局域网将以类似的方式连接到路由器4和5),因为这个连接必须是高可用的。
但是,当然,交换机不能有2个默认网关(对吧?),我不能给路由器在相同的范围内的IP地址。 我将如何最好地解决这个问题? 这样,交换机就可以ping任何这些路由器,并在将来ping任何其他LAN中的设备。
这里是运行configuration:
路由器在左边:
Building configuration... Current configuration : 1291 bytes ! version 12.4 no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption ! hostname Router ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 no ip address duplex auto speed auto ! interface FastEthernet0/0.1 encapsulation dot1Q 1 native ip address 192.168.1.1 255.255.255.0 ! interface FastEthernet0/0.10 encapsulation dot1Q 10 ip address 192.168.10.1 255.255.255.0 ip helper-address 192.168.2.2 ! interface FastEthernet0/0.20 encapsulation dot1Q 20 ip address 192.168.20.1 255.255.255.0 ip helper-address 192.168.2.2 ! interface FastEthernet0/0.30 encapsulation dot1Q 30 ip address 192.168.30.1 255.255.255.0 ip helper-address 192.168.2.2 ! interface FastEthernet0/0.40 encapsulation dot1Q 40 ip address 192.168.40.1 255.255.255.0 ip helper-address 192.168.2.2 ! interface FastEthernet0/0.99 encapsulation dot1Q 99 ip address 192.168.99.1 255.255.255.0 ip helper-address 192.168.2.2 ! interface FastEthernet0/1 ip address 192.168.2.1 255.255.255.0 duplex auto speed auto ! interface Vlan1 no ip address shutdown ! router ospf 1 log-adjacency-changes network 192.168.2.0 0.0.0.255 area 0 network 192.168.1.0 0.0.0.255 area 0 ! ip classless ! ! ! ! ! ! ! line con 0 line vty 0 4 login ! ! ! end
打开左边:
Building configuration... Current configuration : 1907 bytes ! version 12.2 no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption ! hostname Switch ! ! ! interface FastEthernet0/1 switchport trunk native vlan 99 switchport mode trunk ! interface FastEthernet0/2 switchport trunk native vlan 99 switchport mode trunk ! interface FastEthernet0/3 switchport trunk native vlan 99 switchport mode trunk ! interface FastEthernet0/4 switchport trunk native vlan 99 switchport mode trunk ! interface FastEthernet0/5 switchport trunk native vlan 99 switchport mode trunk ! interface FastEthernet0/6 switchport trunk native vlan 99 switchport mode trunk ! interface FastEthernet0/7 switchport trunk native vlan 99 switchport mode trunk ! interface FastEthernet0/8 switchport trunk native vlan 99 switchport mode trunk ! interface FastEthernet0/9 switchport trunk native vlan 99 switchport mode trunk ! interface FastEthernet0/10 switchport trunk native vlan 99 switchport mode trunk ! interface FastEthernet0/11 ! interface FastEthernet0/12 ! interface FastEthernet0/13 ! interface FastEthernet0/14 ! interface FastEthernet0/15 ! interface FastEthernet0/16 ! interface FastEthernet0/17 ! interface FastEthernet0/18 ! interface FastEthernet0/19 ! interface FastEthernet0/20 ! interface FastEthernet0/21 ! interface FastEthernet0/22 ! interface FastEthernet0/23 ! interface FastEthernet0/24 ! interface GigabitEthernet1/1 switchport trunk native vlan 99 switchport mode trunk ! interface GigabitEthernet1/2 switchport trunk native vlan 99 switchport mode trunk ! interface Vlan1 no ip address shutdown ! interface Vlan10 no ip address ! interface Vlan20 no ip address ! interface Vlan30 no ip address ! interface Vlan40 no ip address ! interface Vlan99 ip address 192.168.1.2 255.255.255.0 ! ip default-gateway 192.168.1.1 ! ! line con 0 ! line vty 0 4 login line vty 5 15 login ! ! end
Router6
Building configuration... Current configuration : 630 bytes ! version 12.4 no service timestamps log datetime msec no service timestamps debug datetime msec no service password-encryption ! hostname Router ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface FastEthernet0/0 ip address 172.16.1.1 255.255.255.0 duplex auto speed auto ! interface FastEthernet0/1 ip address 172.16.2.1 255.255.255.0 duplex auto speed auto ! interface Serial0/0/0 no ip address ! interface Serial0/0/1 no ip address ! interface Serial0/1/0 no ip address ! interface Serial0/1/1 no ip address ! interface Vlan1 no ip address shutdown ! ip classless ! ! ! ! ! ! ! line con 0 line vty 0 4 login ! ! ! end
你想看看HSRP。 基本上,路由器5和路由器6将共享192.168.1.1,但他们的真实地址将是.200和.201(例如)。
HSRP使非路由(静态)主机能够获得高可用性。 这是这个想法的主旨,我会在稍后添加更多的configuration。
HSRP可能是你最好的select,但是因为它看起来像你正在运行一个路由协议,你可以看看传递默认路由。 只要确保备份默认路由具有较高的指标(如254)作为备份或帮助networking冷启动。
似乎在L3 3550上支持的另一个选项是使用ip sla和轨道表。 我没有在交换机上使用它,但是在分支路由器上成功使用它来在路由变得不可路由时切换默认路由。
ip sla 4 icmp-echo 10.10.10.2 source-interface FastEthernet0 threshold 1000 frequency 5 ip sla schedule 4 life forever start-time now track 4 ip sla 4 delay down 5 up 3 ip route 0.0.0.0 0.0.0.0 1.1.1.1 track 4
跟踪表也可以与路由映射一起使用set ip next-hop verify-availability 1.1.1.1 250 track 4
我猜这些可能与L3 3560或2960或更高版本一起工作,但不能肯定地说。 我仍然投票通过OSPF传递默认路由:)