1-5[Switch] interface Vlan-interface 1[Switch-Vlan-interface1] ip address 129.2.2.1 255.255.255.0IP Address Configuration Example IINetwork requirementsAs shown in Figure 1-4 VLAN-interface 1 on a switch is connected to a LAN comprising two segments:172.16.1.0/24 and 172.16.2.0/24.To enable the hosts on the two network segments to communicate with the external network through theswitch, and the hosts on the LAN can communicate with each other, do the following:z Assign two IP addresses to VLAN-interface 1 on the switch.z Set the switch as the gateway on all PCs of the two networks.Network diagramFigure 1-4 Network diagram for IP address configurationConfiguration procedure# Assign a primary IP address and a secondary IP address to VLAN-interface 1. system-view[Switch] interface Vlan-interface 1[Switch-Vlan-interface1] ip address 172.16.1.1 255.255.255.0[Switch-Vlan-interface1] ip address 172.16.2.1 255.255.255.0 sub# Set the gateway address to 172.16.1.1 on the PCs attached to the subnet 172.16.1.0/24, and to172.16.2.1 on the PCs attached to the subnet 172.16.2.0/24.# Ping a host on the subnet 172.16.1.0/24 from the switch to check the connectivity. ping 172.16.1.2PING 172.16.1.2: 56 data bytes, press CTRL_C to breakReply from 172.16.1.2: bytes=56 Sequence=1 ttl=255 time=25 msReply from 172.16.1.2: bytes=56 Sequence=2 ttl=255 time=27 msReply from 172.16.1.2: bytes=56 Sequence=3 ttl=255 time=26 msReply from 172.16.1.2: bytes=56 Sequence=4 ttl=255 time=26 msReply from 172.16.1.2: bytes=56 Sequence=5 ttl=255 time=26 ms