Bu bölümde inter VLAN routing yapmayı, tek bir fiziksel interface üzerinde sub-interface oluşturma, VLAN’lar arasında arp broadcast trafiğini aktif etmeyi göreceğiz.
-
Genel konfigürasyon
CLIGURU-R1,CLIGURU-R3 ve CLIGURU-S1 konfigürasyonu ile başlayalım, cihazlara isim ve ip addresslerini verelim.
CLIGURU-R1 için G0/0/1’e ip address 10.0.4.1/24 olarak verelim.
<Huawei>system-viewEnter system view, return user view with Ctrl+Z.[Huawei]sysname CLIGURU-R1[CLIGURU-R1]interface GigabitEthernet 0/0/1[CLIGURU-R1-GigabitEthernet0/0/1]ip address 10.0.4.1 24 |
CLIGURU-R3 için G0/0/1’e ip address 10.0.8.1/24 olarak verelim.
<Huawei>system-viewEnter system view, return user view with Ctrl+Z.[Huawei]sysname CLIGURU-R3[CLIGURU-R3]interface GigabitEthernet 0/0/1[CLIGURU-R3-GigabitEthernet0/0/1]ip address 10.0.8.1 24 |
2. Vlan konfigürasyonu .
CLIGURU-S1’de vlan 4 ve 8 oluşturalım. Interface G0/0/1 VLAN 4 ve interface G0/0/3’de VLAN 8 dahil olacak şekilde ayarlayalım.
<Huawei>system-viewEnter system view, return user view with Ctrl+Z.[Huawei]sysname CLIGURU-S1[CLIGURU-S1]vlan batch 4 8Info: This operation may take a few seconds. Please wait for a moment…done.[CLIGURU-S1]interface GigabitEthernet 0/0/1[CLIGURU-S1-GigabitEthernet0/0/1]port link-type access[CLIGURU-S1-GigabitEthernet0/0/1]port default vlan 4[CLIGURU-S1-GigabitEthernet0/0/1]quit[CLIGURU-S1]interface GigabitEthernet 0/0/3[CLIGURU-S1-GigabitEthernet0/0/3]port link-type access[CLIGURU-S1-GigabitEthernet0/0/3]port default vlan 8[CLIGURU-S1-GigabitEthernet0/0/3]quit |
Interface G0/0/2 de VLAN 4 ve 8’in iletişime geçebilmesi için interface’i trunk olarak ayarlayalım.
[CLIGURU-S1]interface GigabitEthernet 0/0/2[CLIGURU-S1-GigabitEthernet0/0/2]port link-type trunk[CLIGURU-S1-GigabitEthernet0/0/2]port trunk allow-pass vlan 4 8 |
3. CLIGURU-R2 üzerinden Sub-interface ve VLAN routing konfigürasyonu.
Sub-interface G0/0/1.1 ‘i oluşturalım ve VLAN 4 için gateway olacak şekilde konfigure edelim ve G0/0/1.3 için VLAN 8’e gateway olarak konfigure edelim.
<Huawei>system-viewEnter system view, return user view with Ctrl+Z.[Huawei]sysname CLIGURU-R2[CLIGURU-R2]interface GigabitEthernet 0/0/1.1[CLIGURU-R2-GigabitEthernet0/0/1.1]ip address 10.0.4.254 24[CLIGURU-R2-GigabitEthernet0/0/1.1]dot1q termination vid 4[CLIGURU-R2-GigabitEthernet0/0/1.1]arp broadcast enable[CLIGURU-R2-GigabitEthernet0/0/1.1]quit[CLIGURU-R2]interface GigabitEthernet 0/0/1.3[CLIGURU-R2-GigabitEthernet0/0/1.3]ip address 10.0.8.254 24[CLIGURU-R2-GigabitEthernet0/0/1.3]dot1q termination vid 8[CLIGURU-R2-GigabitEthernet0/0/1.3]arp broadcast enable |
CLIGURU-R1 ve CLIGURU-R3 arasındaki bağlantıyı kontrol edelim.
<CLIGURU-R1>ping 10.0.8.1PING 10.0.8.1: 56 data bytes, press CTRL_C to breakRequest time outRequest time outRequest time outRequest time outRequest time out— 10.0.8.1 ping statistics —5 packet(s) transmitted0 packet(s) received100.00% packet loss |
CLIGURU-R1 ve CLIGURU-R3 üzerinde default route konfigurasyonu yapalım.
[CLIGURU-R1]ip route-static 0.0.0.0 0.0.0.0 10.0.4.254 |
[CLIGURU-R3]ip route-static 0.0.0.0 0.0.0.0 10.0.8.254 |
Tekrar CLIGURU-R1 ve CLIGURU-R3 bağlantısını kontrol edelim.
<CLIGURU-R1>ping 10.0.8.1PING 10.0.8.1: 56 data bytes, press CTRL_C to breakReply from 10.0.8.1: bytes=56 Sequence=1 ttl=254 time=290 msReply from 10.0.8.1: bytes=56 Sequence=2 ttl=254 time=160 msReply from 10.0.8.1: bytes=56 Sequence=3 ttl=254 time=120 msReply from 10.0.8.1: bytes=56 Sequence=4 ttl=254 time=60 msReply from 10.0.8.1: bytes=56 Sequence=5 ttl=254 time=90 ms— 10.0.8.1 ping statistics —5 packet(s) transmitted5 packet(s) received0.00% packet lossround-trip min/avg/max = 60/144/290 ms |
<CLIGURU-R2>display ip routing-tableRoute Flags: R – relay, D – download to fib—————————————————————————Routing Tables: PublicDestinations : 8 Routes : 8Destination/Mask Proto Pre Cost Flags NextHop Interface10.0.4.0/24 Direct 0 0 D 10.0.4.254 GigabitEthernet0/0/1.110.0.4.1/32 Direct 0 0 D 10.0.4.1 GigabitEthernet0/0/1.110.0.4.254/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1.110.0.8.0/24 Direct 0 0 D 10.0.8.254 GigabitEthernet0/0/1.310.0.8.1/32 Direct 0 0 D 10.0.8.1 GigabitEthernet0/0/1.310.0.8.254/32 Direct 0 0 D 127.0.0.1 GigabitEthernet0/0/1.3127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 |
Final …
<CLIGURU-R1>display current-configuration#sysname CLIGURU-R1#interface GigabitEthernet0/0/1ip address 10.0.4.1 255.255.255.0#ip route-static 0.0.0.0 0.0.0.0 10.0.4.254#user-interface con 0user-interface vty 0 4user-interface vty 16 20#Return |
<CLIGURU-R2>display current-configuration#sysname CLIGURU-R2#interface GigabitEthernet0/0/1#interface GigabitEthernet0/0/1.1dot1q termination vid 4ip address 10.0.4.254 255.255.255.0arp broadcast enable#interface GigabitEthernet0/0/1.3dot1q termination vid 8ip address 10.0.8.254 255.255.255.0arp broadcast enable#user-interface con 0user-interface vty 0 4user-interface vty 16 20#Return |
[CLIGURU-R3]display current-configuration#sysname CLIGURU-R3#interface GigabitEthernet0/0/1ip address 10.0.8.1 255.255.255.0#ip route-static 0.0.0.0 0.0.0.0 10.0.8.254#user-interface con 0user-interface vty 0 4user-interface vty 16 20#Return |
<CLIGURU-S1>display current-configuration#sysname CLIGURU-S1#vlan batch 4 8#interface GigabitEthernet0/0/1port link-type accessport default vlan 4#interface GigabitEthernet0/0/2port link-type trunkport trunk allow-pass vlan 4 8#interface GigabitEthernet0/0/3port link-type accessport default vlan 8#user-interface con 0user-interface vty 0 4#return |