Hosts on multiple network segments in the same VLAN can communicate after the primary and secondary IP addresses for a VLANIF interface are configured.
As shown in Figure 1, 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 0/0/1 [Switch-GigabitEthernet0/0/1] port link-type access [Switch-GigabitEthernet0/0/1] port default vlan 10 [Switch-GigabitEthernet0/0/1] quit [Switch] interface gigabitethernet 0/0/2 [Switch-GigabitEthernet0/0/2] port link-type access [Switch-GigabitEthernet0/0/2] port default vlan 10 [Switch-GigabitEthernet0/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.