Reference Guide
IP Addressing 195
Configuring Two IP Networks on Two Different VLANS Using CLI
The following shows how to configure two IP networks on two different
VLANS using CLI:
To test the setup described in Figure 8-1:
1
Connect a host whose address is 1.1.1.2 to interface te1/1 (default route
1.1.1.1)
2
Connect a host whose address 2.1.1.2 to interface te1/2(default route
2.1.1.1)
3
Ping from 1.1.1.2 to 2.1.1.2 to verify the configuration
Table 8-10. Sample CLI Script to Configure Two IP Networks on Two Different VLANSs
CLI Command Description
console#config Enter Global Configuration
mode.
console(config)# vlan database Enter VLAN mode.
console(config-vlan)# vlan 100-150 Create VLANs number 100 to
150.
console(config-vlan)# exit Exit VLAN mode.
console(config)#interface te1/1 Enter Interface mode for port
1.
console(config-if)# switchport access
vlan 100
Make port a member of
VLAN 100.
console(config-if)# ip address
1.1.1.1 255.255.255.0
Set the IP address with mask.
console(config-vlan)# exit Exit Interface mode for port.
console(config)#interface te1/2 Enter Interface mode for port
2.
console(config-if)# switchport access
vlan 150
Make port a member of
VLAN 150.
console(config-if)# ip address
2.1.1.1 255.255.255.0
Set the IP address with mask.
console(config-vlan)# exit Exit Interface mode for port.










