Can Multiple Network Segments Be Configured in a VLAN?
Hosts on multiple network segments in the same VLAN can communicate by configuring the primary and secondary IP addresses for a VLANIF interface.
In Figure 4-37, Host_1 and Host_2 in VLAN 10 belong to 10.1.1.1/24 and 10.1.2.1/24 respectively. The two hosts need to communicate.
Configure the Switch.
[Switch] interface gigabitethernet 1/0/1 [Switch-GigabitEthernet1/0/1] port link-type access [Switch-GigabitEthernet1/0/1] port default vlan 10 [Switch-GigabitEthernet1/0/1] quit [Switch] interface gigabitethernet 1/0/2 [Switch-GigabitEthernet1/0/2] port link-type access [Switch-GigabitEthernet1/0/2] port default vlan 10 [Switch-GigabitEthernet1/0/2] quit [Switch] interface vlanif 10 [Switch-Vlanif10] ip address 10.1.1.1 24 [Switch-Vlanif10] ip address 10.1.2.1 24 sub [Switch-Vlanif10] quit
After the preceding configurations are performed, Host_1 and Host_2 can communicate.