- Bronze, 100 points or more
Hi every body!
I understand Cisco'S recommendation about one-to-one correspondence between vlan and ip subnet.
MY book says though it is not good pratice but one vlan can have more than one ip subnet.
For example two host h1 and h2 are connected to hub which is connected to multilayer switch.
sw' fo/1 is vlan 1.
h1 is in subnet 18.104.22.168/24
h2 is in subnet 22.214.171.124/24
Can we configur interface vlan 1 as 126.96.36.199 and also as 188.8.131.52?
I feel there is no way we can configure two ip address on single interface.
Then h1 can not communicate with h2 .
Let say h1 pings h2 which should be unsuccessful . Here is why:
1) h1 sends ping packet with destination mac= switch's vlan 1 interface.
2) sw receives the packet and finds its own mac address. Sw concludes this packet is meant for layer-3 switching.
3)Sw checks the destination subnet 184.108.40.206 in its routing table and find there is no match( that would be the case if my assumption about interface not having two ip address is correct).
sw simply drops the packet. The result is no communication between h1 and h2.
If my understanding is correct,then what is the point of recommendation by Cisco about one-to-one correspondence between vlan and ip subnet as having more than ip subnet per vlan would not result in communication between the hosts in vlan.
thanks a lot!
As others have indicated you can use the secondary option when inserting the IP address under the SVI for additional IP subnets.
You may find this kind of configuration on production networks in the process of re-ipn'g the network.
To ping a device from one IP subnet to the other IP subnet in the same Layer2 Vlan, just use the same thought process as if they were in different Layer2 Vlans - that is, point their default gateway to the SVI in their respective IP subnet.
220.127.116.11/24 will point to 18.104.22.168
22.214.171.124/24 will point to 126.96.36.199
yup just use a secondary address on the same SVI , as far as I know there are no limitations on how many you can add , its just not good practice at all to have more than 1 or 2 , preferably 1 per SVI.
int vlan 1
ip add 188.8.131.52 255.255.255.0 secondary