vlaninter-vlanroas
MDstable
NoteSnippetChecklistPlaybook
Inter-VLAN Routing — Router-on-a-Stick & SVI
Configurer le routage inter-VLAN via sous-interfaces (ROAS) et SVI sur switch L3
snippetintermediate 2025-05-14 4 min read
vlaninter-vlanroassviciscolayer3routing
Concepts
Inter-VLAN Routing permettre la communication entre VLANs diffrents via un quipement L3Deux mthodes principalesROAS Router-on-a-Stick) routeur externe une interface physique trunk sous-interfacesSVI Switch Virtual Interface switch L3 fait le routage en interne plus performantROAS simple conomique mais cre un bottleneck sur linterface physiqueSVI meilleure perf moins de cblage ncessite un switch L3 ex 3560 3650 3850 9300
Router-on-a-Stick (ROAS)
Topologie
SW access/trunk --- trunk 802 --- Routeur Gi0/0Gi0/0.10 VLAN 10 gatewayGi0/0.20 VLAN 20 gatewayGi0/0.99 VLAN mgmt
Configuration switch (côté trunk)
text
conf tinterface GigabitEthernet0/1switchport mode trunkswitchport trunk encapsulation dot1qswitchport trunk allowed vlan 10,20,30,99switchport trunk native vlan 999no shutdown
Configuration routeur
text
Variables
{{VLAN10_GW}}
{{VLAN10_MASK}}
{{DHCP_SERVER}}
{{VLAN20_GW}}
{{VLAN20_MASK}}
{{VLAN30_GW}}
{{VLAN30_MASK}}
{{MGMT_GW}}
{{MGMT_MASK}}
conf t! Activer l'interface physique parente — SANS IPinterface GigabitEthernet0/0no ip addressno shutdown! VLAN 10 — LAN Utilisateursinterface GigabitEthernet0/0.10encapsulation dot1Q 10ip address {{VLAN10_GW}} {{VLAN10_MASK}}ip helper-address {{DHCP_SERVER}} ! relay DHCP si besoinno shutdown! VLAN 20 — LAN Serveursinterface GigabitEthernet0/0.20encapsulation dot1Q 20ip address {{VLAN20_GW}} {{VLAN20_MASK}}no shutdown! VLAN 30 — VoIPinterface GigabitEthernet0/0.30encapsulation dot1Q 30ip address {{VLAN30_GW}} {{VLAN30_MASK}}no shutdown! VLAN 99 — Managementinterface GigabitEthernet0/0.99encapsulation dot1Q 99ip address {{MGMT_GW}} {{MGMT_MASK}}no shutdown
Native VLAN sur le routeur (si besoin)
text
! Native VLAN = pas de tag 802.1Q — ne pas mettre dot1Q native sur ROAS en prodinterface GigabitEthernet0/0.999encapsulation dot1Q 999 nativeno ip address ! VLAN poubelle, pas d'IP
SVI — Switch Virtual Interface (L3 Switch)
Prérequis : activer le routage IP
text
conf t! Indispensable — sans ça, les SVIs sont up mais ne routent pasip routing
Créer les SVIs
text
Variables
{{VLAN10_GW}}
{{VLAN10_MASK}}
{{DHCP_SERVER}}
{{VLAN20_GW}}
{{VLAN20_MASK}}
{{VLAN30_GW}}
{{VLAN30_MASK}}
{{MGMT_GW}}
{{MGMT_MASK}}
conf t! SVI VLAN 10interface Vlan10description ** LAN Utilisateurs **ip address {{VLAN10_GW}} {{VLAN10_MASK}}ip helper-address {{DHCP_SERVER}}no shutdown! SVI VLAN 20interface Vlan20description ** LAN Serveurs **ip address {{VLAN20_GW}} {{VLAN20_MASK}}no shutdown! SVI VLAN 30interface Vlan30description ** VoIP **ip address {{VLAN30_GW}} {{VLAN30_MASK}}no shutdown! SVI Managementinterface Vlan99description ** Management **ip address {{MGMT_GW}} {{MGMT_MASK}}no shutdown
Route par défaut vers le WAN
text
Variables
{{UPSTREAM_GW}}
! Pointer vers le routeur/firewall upstreamip route 0.0.0.0 0.0.0.0 {{UPSTREAM_GW}}
Ports access sur le switch L3
text
! Les ports access restent identiquesinterface GigabitEthernet1/0/1switchport mode accessswitchport access vlan 10spanning-tree portfastno shutdowninterface GigabitEthernet1/0/2switchport mode accessswitchport access vlan 20no shutdown
Lien routed vers le routeur upstream (alternative au SVI)
text
Variables
{{L3_LINK_SW}}
{{L3_LINK_MASK}}
! Sur un switch L3, on peut aussi router directement une interface physiqueinterface GigabitEthernet1/0/24description ** Uplink vers Routeur WAN **no switchport ! passe en mode routed (L3)ip address {{L3_LINK_SW}} {{L3_LINK_MASK}}no shutdown
Vérifications
text
! Table de routage — doit voir les réseaux VLAN en "C" (connected)show ip routeshow ip route connectedshow ip route ospf ! si OSPF redistribue les SVIs! État des SVIsshow interfaces vlan 10show interfaces vlan 20show ip interface brief | include Vlan! Trunksshow interfaces trunkshow interfaces GigabitEthernet0/0.10! Adjacences L3 (si routage dynamique)show ip ospf neighborshow ip arp vlan 10
Ping inter-VLAN
text
Variables
{{VLAN10_GW}}
{{VLAN20_GW}}
{{HOST_VLAN20}}
! Depuis le routeur — tester la joignabilité des gatewaysping {{VLAN10_GW}} source GigabitEthernet0/0.20ping {{VLAN20_GW}} source GigabitEthernet0/0.10! Depuis un hôte VLAN 10 vers VLAN 20! ping {{HOST_VLAN20}}! traceroute {{HOST_VLAN20}} → doit passer par la gateway VLAN 10
ROAS vs SVI — Comparaison
Critre ROAS SVI switch L3Matriel requis Routeur switch L2 Switch L3 uniquementCot Plus lev 2 quipements Moindre en prod 1 quipementPerformance Limit par linterface trunk Hardware switching trs rapideScalabilit Mauvaise >20 VLANs pb ExcellenteComplexit config Faible Faible ip routingFonctions avances NAT ACL avances VPN Moins de fonctions que routeurCas dusage Lab petits sites SOHO Production datacenter campus
💡 Tip —
Sur un switch L3, si le routage inter-VLAN ne fonctionne pas malgré des SVIs configurées, vérifier en premier : show running-config | include ip routing — la commande ip routing doit être présente. Sans elle, le switch reste en mode L2 et les SVIs ne routent pas, même si elles affichent "up/up".
OPS·BRAIN v1.027 notes · Networklocal