Example for Configuring Routed Interface


Networking Requirements

Figure 1.  Routed Interface and Sub-interface Configuration Example

As shown in Figure 1, PC1 and PC2 are local computers which belong to VLAN 10 and VLAN 20 respectively, and they are in different network segments 172.168.10.10/24 and 172.168.20.20/24 respectively. They connect to the layer 3 device Switch B through the layer 2 device Switch A. There is only one free physical port ge-1/1/3 on Switch B. In this scenario, it is required that Switch B can connect to two different network segments through only one physical port.

This can be accomplished by enabling interface ge-1/1/3 as a routed interface, under it configuring two different sub-interfaces to connect to PC1 and PC2 respectively.

Complete the following configurations on the Switch B:

  • Enable interface ge-1/1/3 as a routed interface and name its layer 3 interface as rif-ge3.
  • Create two layer 3 sub-interfaces, rif-ge3.1 and rif-ge3.2, assign IP addresses 172.168.10.10/24 and 172.168.20.20/24, to serve as gateway addresses for VLAN 10 and VLAN 20 users, respectively.

Procedure

Switch A

As a layer 2 switch, Switch A needs to configure VLANs and add the access ports to the corresponding VLANs.

admin@XorPlus# set vlans vlan-id 10
admin@XorPlus# set vlans vlan-id 20
admin@XorPlus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching native-vlan-id 10
admin@XorPlus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching native-vlan-id 20
admin@XorPlus# set interface gigabit-ethernet ge-1/1/3 family ethernet-switching port-mode trunk
admin@XorPlus# set interface gigabit-ethernet ge-1/1/3 family ethernet-switching vlan members 10
admin@XorPlus# set interface gigabit-ethernet ge-1/1/3 family ethernet-switching vlan members 20
admin@XorPlus# commit

Switch B

Step 1         Configure two VLANs.

admin@XorPlus# set vlans vlan-id 10
admin@XorPlus# set vlans vlan-id 20

Step 2         Configure reserved VLAN for the use of routed interface.

admin@XorPlus# set vlans reserved-vlan 80-90

Step 3         Enable Ethernet port ge-1/1/3 as a layer 3 routed interface.

NOTE:

To avoide conflict with the preserved interface names, the routed interface name and sub-interface name must start with the string "rif-". Otherwise, commit will fail with the error message "The name of interface must start with "rif-".

admin@XorPlus# set interface gigabit-ethernet ge-1/1/3 routed-interface enable true
admin@XorPlus# set interface gigabit-ethernet ge-1/1/3 routed-interface name rif-ge3

Step 4        Run the following command to bring up the parent routed interface. Only after this, the corresponding sub-interfaces can be used normally.

admin@XorPlus# set l3-interface routed-interface rif-ge3

Step 5        Create the sub-interfaces and specify the IP addresses.

admin@XorPlus# set interface gigabit-ethernet ge-1/1/3 routed-interface sub-interface rif-ge3.1 vlan-id 10
admin@XorPlus# set interface gigabit-ethernet ge-1/1/3 routed-interface sub-interface rif-ge3.2 vlan-id 20
admin@XorPlus# set l3-interface routed-interface rif-ge3.1 address 172.168.10.10 prefix-length 24
admin@XorPlus# set l3-interface routed-interface rif-ge3.2 address 172.168.20.20 prefix-length 24

Step 6         Enable IP routing to perform layer 3 forwarding.

admin@XorPlus# set ip routing enable true

Step 7         Commit the configuration.

admin@XorPlus# commit

Step 8         Verify the configuration.

  • After the above configurations are completed, ping PC1 from PC2 to test the connectivity.
  • Run the command run show vlans routed-vlan to check the VLAN information of the routed interfaces and sub-interfaces.         
admin@SwitchB# run show vlans routed-vlan
VlanID  Vlan Name           Tag        Interfaces     Routed-interfaces
------  ------------------  --------   ------------   --------------------
10      default             tagged      ge-1/1/3       rif-ge3.1                   
20      default             tagged      ge-1/1/3       rif-ge3.2          
80                          untagged      ge-1/1/3       rif-ge3  
  • Run the command run show interface routed-interface brief to check the brief information of the routed interfaces and sub-interfaces.
admin@Xorplus# run show interface routed-interface brief
Interface       RoutedIfName     SubRoutedIfName  VLANID  Management  Status  Flow Control   Duplex  Speed    Description
--------------  ---------------  ---------------   ------ ----------  ------  ------------   ------  -------  -----------
ge-1/1/3        rif-ge3                            80      Enabled     Up      Disabled      Full     Auto   
                                 rif-ge3.1         10   
                                 rif-ge3.2         20   
  • Run the command run show l3-interface routed-interface <interface-name> to check the detailed layer 3 information of a specific routed interface or sub-interface.
admin@Xorplus# run show l3-interface routed-interface rif-ge3
rif-ge3         Hwaddr 18:5A:58:1F:63:A1, Vlan:80, MTU: 1500, State:UP
            Inet addr: 120:1:1::49/64
                       fe80::1a5a:5820:131f:63a1/64
            Traffic statistics:
              5 sec input rate IPv4 0 packets/sec, IPv6 0 packets/sec
              5 sec forwarding rate IPv4 0 packets/sec, IPv6 0 packets/sec
              IPv4 Input Packets............................0
              IPv4 Forwarding Packets.......................0
              IPv6 Input Packets............................0
              IPv6 Forwarding Packets.......................0

Copyright © 2024 Pica8 Inc. All Rights Reserved.