Article directory
router virtual subinterface
We know that the port of the router connected to the terminal should be set as the gateway of the terminal, and now the switch divides a network segment into three through VLAN technology, so how to configure three gateway addresses for one port of the router? Sub-interface technology is needed now, virtualize a port into multiple interfaces, encapsulate their respective VLAN numbers, and configure gateway addresses for terminal devices in each VLAN. F0/0 can be divided into
f0/0.1, f0/0.2...
or Divide f0/1 into f0/1.1, f0/1.2...
and so
on
configuration steps
In global configuration mode
1. Create/enter sub-interface: interface sub-interface port number (such as int f0/0.1)
2. Encapsulation vlan number: encapsulation dot1Q vlan number (en do vlan number)
3. Set ip address: ip address IP address subnet mask (ip add IP address subnet mask)
About encapsulation: encapsulate which vlan number you want to be the gateway of any vlan
For example, if you want to create a f0/0.1 sub-interface as the gateway of the device in vlan10
int f0/0.1
en do 10
ip add 192.168.1.254 255.255.255.0
configuration is complete
configuration process
For example, configure three VLANs (10, 20, 30) on the switch
and configure three sub-interfaces on the router to assign gateways:
switch configuration
Put the mouse cursor on the switch and check the port information of the switch. 0/1, 0/2, and 0/3 are now enabled, but all VLANs are 1 by default. Now start to configure the switch
Now let’s check the port information of the switch again. The
created vlan has been assigned to the port, and the vlan of port 0/4 is –, which proves that it is now in trunk mode.
router interface configuration
Up to now, the three sub-interfaces of the router have been configured as the gateway of the corresponding vlan network segment
Dynamic Routing Configuration
Here, eigrp is used to route
Router0 uniformly:
Router1:
The configuration is complete
Articles in the same series
Basic Getting Started Tutorial
[Routing and switching technology] Cisco Packet Tracer basic tutorial (1)
[Routing and switching technology] Cisco Packet Tracer basic tutorial (2)
[Routing and switching technology] Cisco Packet Tracer basic tutorial (3)
Specific function articles
Three command modes of Cisco Packet Tracer configuration operation
How Cisco Packet Tracer builds topology and connects (basic)
Cisco Packet Tracer configures static routing
Cisco Packet Tracer configures dynamic routing (RIP, OSPF, EIGRP)
Switch VLAN configuration in Cisco Packet Tracer
My ability is limited, insufficient, please point out the mistakes, if you
have any questions, please leave a comment