Hello Chris,
When you create a VLAN and assign an IP address with the interface vlan <vlan_number> command, the VLAN becomes a Layer 3 VLAN. In Layer 3 switches, the hosts between the two VLANs can communicate with each other (if the hosts are configured with the default gateway as the VLAN interface IP address). You can use ACLs to deny communication between the VLANs.
This section shows an example of how to isolate the communication between a newly created Layer 3 VLAN's
In this example, the Layer3 switch has three VLANs (VLAN 1 , VLAN 2 and VLAN 3). VLAN 1, VLAN 2 and VLAN 3 are Layer 3 VLANs. ACLs are implemented to allow traffic so that VLAN 3 can communicate with VLAN 1 and VLAN 2 and deny the traffic so that VLAN 1 and VLAN 2 does not communicate each other.
* VLAN 1 - 10.10.10.0 /24
* VLAN 2 - 172.16.1.0 /24
* VLAN 3 - 192.168.1.0 /24 (Admin Vlan )
1. Create the new VLAN in the database. In this case the new VLAN is VLAN 3. When you exit vlan database mode, the configuration changes are applied.
Code:
Switch#vlan database
Switch(vlan)#vlan 3
VLAN 3 added:
Name: VLAN0001
Switch(vlan)#exit
APPLY completed.
Exiting....
2.Make sure the VLAN is created in the vlan database. Check the output of the show vlan command.
3. Set an IP address for the newly created VLAN.
Code:
Switch(config)#interface vlan 3
Switch(config-if)#ip address 192.168.1.1 255.255.255.0
Switch(config)#no shut
4. Please create other vlan with same above s
5. Configure physical interfaces that connect the clients to the corresponding VLAN.
Code:
Switch(config)#interface fastEthernet 2/1
Switch(config-if)#switchport mode access
Switch(config-if)#switchport access vlan 3
Switch(config-if)#no shut
You need to configure three access-lists, one for each VLAN.
* This access list denies traffic that comes from VLAN 1 to get to VLAN 2.
Code:
Switch#configure terminal
Switch(config)#access-list 101 deny
ip 10.10.10.0 0.0.0.255 172.16.1.0 0.0.0.255
Switch(config)#access-list 101 permit ip 10.10.10.0 0.0.0.255 any
* This access list denies traffic that comes from VLAN 2 to get to VLAN 1.
Code:
Switch#configure terminal
Switch(config)#access-list 102 deny ip 172.16.1.0 0.0.0.255 192.168.1.0 0.0.0.255
Switch(config)#access-list 102 permit ip 172.16.1.0 0.0.0.255 any
* This access list denies traffic that comes from VLAN 3 to get to VLAN 1 and VLAN 2.
Code:
Switch#configure terminal
Switch(config)#access-list 105 permit ip 192.168.1.0 0.0.0.255 10.10.10.0 0.0.0.255
Switch(config)#access-list 105 permit ip 192.168.1.0 0.0.0.255 172.16.1.0 0.0.0.255
Switch(config)#access-list 105 permit ip10.10.10.0 0.0.0.255 any
And once they are configured, apply the access lists to interface VLAN 1, interface VLAN 2 and interface VLAN 3.
Code:
Switch#configure terminal
Switch(config)#interface vlan 1
Switch(config-if)#ip access-group 101 in
Switch(config-if)#exit
Switch#configure terminal
Switch(config)#interface vlan 2
Switch(config-if)#ip access-group 102 in
Switch(config-if)#exit
Switch#configure terminal
Switch(config)#interface vlan 5
Switch(config-if)#ip access-group 103 in
Switch(config-if)#end
Please let us know if still you have any queries.