How to create a vlan on a cisco switch
Do the same to create a sub-interface for VLAN-B also. This sub-interface act as a default gateway for VLAN-A with an address of 192.168.10.8/29.ĥ. The virtual sub-interface FastEthernet0/0.2 has created and it has the 192.168.10.9 IP address. See the result with “ do show ip interface brief” from sub-interface area. Router(config-subif)#encapsulation dot1Q 2 Router(config)#interface fastEthernet 0/0.2 In this case, I have subnetted the 192.168.10.0/24 IP address to 3 networks. Now try to create a subinterface for each VLAN with interface command and assign IP address from the different network for each VLAN. The subinterface is a virtual interface card that inter-VLAN doing routing using them.ģ. Note: We need to have subinterface for each VLANs on the router. Good, the IP 192.168.10.1 with the subnet mask of 255.255.255.248 is assigned for physical FastEthernet 0/0 interface. Router(config)#interface fastEthernet 0/0 Try to assign an IP address to the router and enable the interface you want to configure inter-VLAN routing. Just need Inter-VLAN Routing which you simply configure according to below step by step Inter-VLAN routing guide.ġ. Not network routing protocols such as Static routing or dynamic routing like RIP, and OSPF. So in order to communicate they need routing. If you test the PCs, they can ping with each other within a VLAN but not with other VLANs. Configure Inter-VLAN Routing on Cisco Routerįinally, the lab is ready to configure Inter-VLAN routing. It’s not necessary to enable it on the interface of the switch to PC. Note: Try to enable trunking mode only to interface between to switch or router devices. Now the VLANs can transmit traffic over the FastEthernet 0/1 without any problems. Switch(config)#interface fastEthernet 0/1Ģ. Just navigate to FastEthernet 0/1 interface and type “ switchport mode trunk“ the press enter to enable trunking on Fa0/1 interface line. The VLAN Trunking Protocol (VTP) let the VLANs transmit theirs traffics over a physical line simultaneously. With the command “ switch port mode trunk” you can configure trunking on the FastEthernet 0/1 port of the SW1. Let’s enable Trunking mode on the switch port to the router and then configure Inter-VLAN routing on the router. Assign Switch Ports to VLANĤ. Now we have just done the basic VLAN configuration like creating VLAN and assigning switch ports to VLANs. Read more about basic VLAN configuration on “ Configure VLAN on Cisco Switches Using Cisco Packet Tracer” post. Note: The interface range command can assign a range of interfaces to a VLAN. Switch(config-if-range)#switchport access vlan 3 Switch(config-if-range)#switchport mode access Switch(config)#interface range fastEthernet 0/3-4 Let’s assign a range of ports to a VLAN using “ interface range” command. Now the port FastEthernet 0/2 and FastEthernet 0/5 are members of VLAN 2 which named VLAN-A. Switch(config)#interface fastEthernet 0/5Ģ. Switch(config-if)#switchport access vlan 2 Assigning Switch Ports to VLANs Switch(config)#interface fastEthernet 0/2 So let’s configure it.ġ. Try to assign switch ports for each VLANs with the following commands. Before configuring Inter-VLAN routing, a host in a VLAN can only communicate within its own VLAN and not reach to other VLANs. In this section, the switch ports are divide and assign to VLANs. You see the result in the screenshot, the VLANs are ready for assigning switch ports to them. Now check them with “ show vlan” command. OK, the VLANs A and B are created successfully. Switch>enableĮnter configuration commands, one per line. First of all, create two VLAN in the switch and named VLAN A and VLAN B with the following command. Download the Packet Tracer Inter-VLAN routing Lab for CCNA or create your own Lab.ġ. Let’s configure it on the below Inter-VLAN routing Lab.
#How to create a vlan on a cisco switch how to#
Configure Inter VLAN Routing How to Create VLAN on Cisco Switches? You can set IP address for each sub-Interface in order to route between VLANs. In Inter-VLAN the physical Fast Ethernet interface of the router is divided into sub-Interfaces for each VLAN. The router you are using for Inter-VLAN routing must be compatible and support Inter-Switch Link (ISL) which is a Cisco Systems proprietary protocol, and IEEE 802.1q frame format for routing on the Fast Ethernet interfaces. Here we completely demonstrate the Inter-VLAN configuration using a Cisco router and a layer 3 switch. So if you want your VLANs hosts can communicate with each other, you must configure inter-VLAN routing using a router or a layer 3 switch. It means only hosts that are members of the same VLAN can communicate with each other. Basically, on a VLAN, no host can communicate with hosts within other VLANs. A step by step guide to configure Inter-VLAN Routing on the Cisco router or layer 3 switches.