HUAWEIVLAN+OSPF+single-arm routing

Table of Contents

Write in front

3.1. Topology diagram

3.2. Operational ideas

3.3. Configuration operation

3.3.1, LSW2 configuration

3.3.2, LSW3 configuration

3.3.3, R1 configuration

3.3.4, R2 configuration

3.3.5, LSW1 configuration

3.3.6. View configuration list

3.3.7. Test network


Blog homepage: Are prawns delicious blog?

Column address: huawei column

Write in front

VLAN: A VLAN (Virtual LAN) is a logical segmentation of network users connected to a Layer 2 switch port, segmenting the network based on the user’s needs regardless of the network user’s physical location. A VLAN can be implemented on a switch or across switches. The switch-based virtual LAN can solve the conflict domain, broadcast domain, and bandwidth problems for the LAN.

OSPF: OSPF (Open Shortest Path First) is an Interior Gateway Protocol (IGP for short), used to make routing decisions within a single autonomous system (AS).

One-arm routing: One-arm routing (router-on-a-stick) refers to configuring a sub-interface (or “logical interface”, there is no real physical interface) on an interface of the router to achieve mutual isolation. Interconnection between different VLANs (virtual local area networks).

3.1, Topology Map

Picture

3.2, Operation Idea

1. Configure the IPs of the 5 PCs first, configure the access layer switch VLAN, designate 0/0/1 as the trunk link, and configure 0/0/2 and 0/0/3 as access links.

2. Two routers configure single-arm routing to allow multiple VLAN data to pass through, encapsulate dot1q protocol, configure gateway addresses for network segments 1/2/3/4, and configure IP for network segments 5/6.

3. Configure Layer 3 switching with VLAN, IP, and interface type as access.

4. Finally, configure OSPF on the two routers and layer 3 switches. The router_id is 1.1.1.1, 2.2.2.2, and 3.3.3.3 respectively.

5. Test full network interoperability

3.3. Configuration operation

Configure the PC address by yourself, and configure the gateway to 1.

3.3.1, LSW2 configuration

<Huawei>sys
[Huawei]undo info-center enable
[Huawei]vlan batch 10 20
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type trunk
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all #all means allowing all VLANs to pass
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 10
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]port link-type access
[Huawei-Ethernet0/0/3]port default vlan 20

3.3.2, LSW3 configuration

<Huawei>sys
[Huawei]vlan batch 30 40
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]port link-type trunk
[Huawei-Ethernet0/0/1]port trunk allow-pass vlan all #all means allowing all VLANs to pass
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]port link-type access
[Huawei-Ethernet0/0/2]port default vlan 30
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]port link-type access
[Huawei-Ethernet0/0/3]port default vlan 40

3.3.3, R1 configuration

<Huawei>sys
# One-arm routing
[Huawei]int e0/0/0.1
[Huawei-Ethernet0/0/0.1]dot1q termination vid 10
[Huawei-Ethernet0/0/0.1]ip add 1.0.0.1 8
[Huawei-Ethernet0/0/0.1]arp broadcast enable
[Huawei-Ethernet0/0/0.1]int e0/0/0.2
[Huawei-Ethernet0/0/0.2]dot1q termination vid 20
[Huawei-Ethernet0/0/0.2]ip add 2.0.0.1 8
[Huawei-Ethernet0/0/0.2]arp broadcast enable
# 6.0 network segment IP
[Huawei-Ethernet0/0/0.2]int e0/0/1
[Huawei-Ethernet0/0/1]ip add 6.0.0.1 8
#OSPF
[Huawei-Ethernet0/0/1]ospf 1 router-id 1.1.1.1
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]net 1.0.0.0 0.255.255.255
[Huawei-ospf-1-area-0.0.0.1]net 2.0.0.0 0.255.255.255
[Huawei-ospf-1-area-0.0.0.1]net 6.0.0.0 0.255.255.255

3.3.4, R2 configuration

<Huawei>sys
# One-arm routing
[Huawei]int e0/0/0.1
[Huawei-Ethernet0/0/0.1]dot1q termination vid 30
[Huawei-Ethernet0/0/0.1]ip add 3.0.0.1 8
[Huawei-Ethernet0/0/0.1]arp broadcast enable
[Huawei-Ethernet0/0/0.1]int e0/0/0.2
[Huawei-Ethernet0/0/0.2]dot1q termination vid 40
[Huawei-Ethernet0/0/0.2]ip add 4.0.0.1 8
[Huawei-Ethernet0/0/0.2]arp broadcast enable
# 5.0 network segment IP
[Huawei-Ethernet0/0/0.2]int e0/0/1
[Huawei-Ethernet0/0/1]ip add 5.0.0.2 8
#OSPF
[Huawei-Ethernet0/0/1]ospf 1 router-id 2.2.2.2
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]net 3.0.0.0 0.255.255.255
[Huawei-ospf-1-area-0.0.0.1]net 4.0.0.0 0.255.255.255
[Huawei-ospf-1-area-0.0.0.1]net 5.0.0.0 0.255.255.255

3.3.5, LSW1 configuration

<Huawei>sys
# Configure VLAN
[Huawei]vlan batch 50 60 100
[Huawei]int vlan 50
[Huawei-Vlanif50]ip add 5.0.0.1 8
[Huawei-Vlanif50]int vlan 60
[Huawei-Vlanif60]ip add 6.0.0.2 8
[Huawei-Vlanif60]int vlan 100
[Huawei-Vlanif100]ip add 100.0.0.1 8
#Specify interface and VLAN
[Huawei-Vlanif100]int g0/0/1
[Huawei-GigabitEthernet0/0/1]port link-type access
[Huawei-GigabitEthernet0/0/1]port default vlan 60
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]port link-type access
[Huawei-GigabitEthernet0/0/2]port default vlan 50
[Huawei-GigabitEthernet0/0/2]int g0/0/3
[Huawei-GigabitEthernet0/0/3]port link-type access
[Huawei-GigabitEthernet0/0/3]port default vlan 100
#OSPF
[Huawei-GigabitEthernet0/0/3]ospf 1 router-id 3.3.3.3
[Huawei-ospf-1]area 1
[Huawei-ospf-1-area-0.0.0.1]net 5.0.0.0 0.255.255.255
[Huawei-ospf-1-area-0.0.0.1]net 6.0.0.0 0.255.255.255
[Huawei-ospf-1-area-0.0.0.1]net 100.0.0.0 0.255.255.255

3.3.6, View configuration list

Take LSW1 as an example, as follows.

# View VLAN
[Huawei]display vlan
...omit some content...
50 common UT:GE0/0/2(U)
?
60 common UT:GE0/0/1(U)
?
100 common UT:GE0/0/3(U)
?
?
VID Status Property MAC-LRN Statistics Description
-------------------------------------------------- ----------------------------------
?
1 enable default enable disable VLAN 0001
50 enable default enable disable VLAN 0050
60 enable default enable disable VLAN 0060
100 enable default enable disable VLAN 0100
?
# View all current information
[Huawei]display current-configuration
...omit some content...
?
# View routing table
[Huawei]display ip routing-table
Route Flags: R - relay, D - download to fib
-------------------------------------------------- ----------------------------
Routing Tables: Public
         Destinations: 12 Routes: 12
?
Destination/Mask Proto Pre Cost Flags NextHop Interface
?
        1.0.0.0/8 OSPF 10 2 D 6.0.0.1 Vlanif60
        2.0.0.0/8 OSPF 10 2 D 6.0.0.1 Vlanif60
        3.0.0.0/8 OSPF 10 2 D 5.0.0.2 Vlanif50
        4.0.0.0/8 OSPF 10 2 D 5.0.0.2 Vlanif50
        5.0.0.0/8 Direct 0 0 D 5.0.0.1 Vlanif50
        5.0.0.1/32 Direct 0 0 D 127.0.0.1 Vlanif50
        6.0.0.0/8 Direct 0 0 D 6.0.0.2 Vlanif60
        6.0.0.2/32 Direct 0 0 D 127.0.0.1 Vlanif60
      100.0.0.0/8 Direct 0 0 D 100.0.0.1 Vlanif100
      100.0.0.1/32 Direct 0 0 D 127.0.0.1 Vlanif100
      127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
      127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
  
# View OSPF neighbor table
[Huawei]display ospf peer brief
?
     OSPF Process 1 with Router ID 3.3.3.3
          Peer Statistical Information
 -------------------------------------------------- --------------------------
 Area Id Interface Neighbor id State
 0.0.0.1 Vlanif50 2.2.2.2 Full
 0.0.0.1 Vlanif60 1.1.1.1 Full
 -------------------------------------------------- --------------------------
 
 # Save configuration
 <Huawei>save

3.3.7, Test Network

Use the ping command to test whether the entire network is interconnected, as shown below.

PC>ping 1.0.0.10
?
Ping 1.0.0.10: 32 data bytes, Press Ctrl_C to break
From 1.0.0.10: bytes=32 seq=1 ttl=126 time=109 ms
From 1.0.0.10: bytes=32 seq=2 ttl=126 time=125 ms
From 1.0.0.10: bytes=32 seq=3 ttl=126 time=94 ms
From 1.0.0.10: bytes=32 seq=4 ttl=126 time=109 ms
From 1.0.0.10: bytes=32 seq=5 ttl=126 time=93 ms
?
--- 1.0.0.10 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 93/106/125 ms