Routage

Par défaut, les switch L2/L3 ne font pas de routage, même si plusieurs interfaces Vlan sont configurées :

SW1#show ip interface brief | inc Vlan
Vlan1                  10.200.200.200  YES manual up                    up
Vlan10                 10.10.10.1      YES manual up                    up
Vlan20                 20.20.20.1      YES manual up                    up
Vlan30                 30.30.30.1      YES manual up                    up
SW1#show ip route
Default gateway is not set

Host               Gateway           Last Use    Total Uses  Interface
ICMP redirect cache is empty

Une passerelle par défaut peut être configuré afin d’atteindre le switch à des fins administratifs

SW1#conf t
SW1(config)#ip default-gateway 10.200.200.1
SW1#show ip route
Default gateway is 10.200.200.1

Host               Gateway           Last Use    Total Uses  Interface
ICMP redirect cache is empty

Activation du routage niveau 3

SW1#conf t
SW1(config)#ip routing
SW1(config)#^Z

vérification de la table de routage

SW1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is not
*Mar  1 02:41:51.271: %SYS-5-CONFIG_I: Configured from console by consoleset

     20.0.0.0/24 is subnetted, 1 subnets
C       20.20.20.0 is directly connected, Vlan20
     10.0.0.0/24 is subnetted, 2 subnets
C       10.200.200.0 is directly connected, Vlan1
C       10.10.10.0 is directly connected, Vlan10
     30.0.0.0/24 is subnetted, 1 subnets
C       30.30.30.0 is directly connected, Vlan30

Dans ce cas « ip default gateway » n’est plus pris en compte,
« ip route » peut être utilisé pour spécifier une route statique

SW1#conf t
SW1(config)#ip route 0.0.0.0 0.0.0.0 10.200.200.1
SW1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

Gateway of last resort is 10.200.200.1 to network 0.0.0.0

     20.0.0.0/24 is subnetted, 1 subnets
C       20.20.20.0 is directly connected, Vlan20
     10.0.0.0/24 is subnetted, 2 subnets
C       10.200.200.0 is directly connected, Vlan1
C       10.10.10.0 is directly connected, Vlan10
     30.0.0.0/24 is subnetted, 1 subnets
C       30.30.30.0 is directly connected, Vlan30
S*   0.0.0.0/0 [1/0] via 10.200.200.1
This entry was posted in L2 Bridging & Switching. Bookmark the permalink.

Comments are closed.