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.
As shown in Figure 3-27, 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 Router.
[Router] interface ethernet 2/0/1 [Router-Ethernet2/0/1] port link-type access [Router-Ethernet2/0/1] port default vlan 10 [Router-Ethernet2/0/1] quit [Router] interface ethernet 2/0/2 [Router-Ethernet2/0/2] port link-type access [Router-Ethernet2/0/2] port default vlan 10 [Router-Ethernet2/0/2] quit [Router] interface vlanif 10 [Router-Vlanif10] ip address 10.1.1.1 24 [Router-Vlanif10] ip address 10.1.2.1 24 sub [Router-Vlanif10] quit
After the preceding configurations are performed, Host_1 and Host_2 can communicate.