Objective
To configure routing between vlans.Topology
Basic Setting
- PC0 is connected to Fa0/1.
- PC1 is connected to Fa0/2.
- IPs have been configured.
- The router's G6/1 is connected to G1/1 on the switch.
Requirements
- Enable trunk on G1/1 on the switch.
- Create subinterfaces on G6/0 of the router.
- On G6/0.1, the IP is configured as 192.168.0.1 255.255.255.0, and this will be the gateway for VLAN1.
- The IP for G6/0.2 should be configured as 192.168.1.1 255.255.255.0, and this will be the gateway for VLAN2.
Steps
On Router1
Router>enRouter#confi t
Router(config)#interface gigabitEthernet 6/0
Router(config-if)#no sh
Router(config-if)#exit
Router(config)#interface gigabitEthernet 6/0.1 // go to subinterface
Router(config-subif)#encapsulation dot1Q 1 // set this subinterface as the gateway for VLAN1.
Router(config-subif)#ip address 192.168.0.1 255.255.255.0
Router(config-subif)#no sh
Router(config-subif)#exit
Router(config)#interface gigabitEthernet 6/0.2
Router(config-subif)#ip address 192.168.1.1 255.255.255.0
Router(config-subif)#encapsulation d
Router(config-subif)#encapsulation dot1Q 2 // set this as the gateway for VLAN2.
Router(config-subif)#no sh
Check IPs for sub-interfaces
Router#show int g6/0.1
GigabitEthernet6/0.1 is up, line protocol is up (connected)Hardware is PQUICC_FEC, address is 00d0.ba64.77ea (bia 00d0.ba64.77ea)
Internet address is 192.168.0.1/24
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation 802.1Q Virtual LAN, Vlan ID 1
ARP type: ARPA, ARP Timeout 04:00:00,
Last clearing of "show interface" counters never
Router#show int g6/0.2
GigabitEthernet6/0.2 is up, line protocol is up (connected)Hardware is PQUICC_FEC, address is 00d0.ba64.77ea (bia 00d0.ba64.77ea)
Internet address is 192.168.1.1/24
MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation 802.1Q Virtual LAN, Vlan ID 2
ARP type: ARPA, ARP Timeout 04:00:00,
Last clearing of "show interface" counters never
On Switch0
Switch>enSwitch#confi t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int
Switch(config)#interface gigabitEthernet 1/1
Switch(config-if)#switchport mode trunk // set mode to Trunk
Ping PC0 from PC1
PC>ping 192.168.0.2Pinging 192.168.0.2 with 32 bytes of data:
Reply from 192.168.0.2: bytes=32 time=17ms TTL=127
Reply from 192.168.0.2: bytes=32 time=17ms TTL=127
Reply from 192.168.0.2: bytes=32 time=15ms TTL=127
Reply from 192.168.0.2: bytes=32 time=16ms TTL=127
Ping statistics for 192.168.0.2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 15ms, Maximum = 17ms, Average = 16ms
Summary: Subinterfaces,created on the G Ethernet interface which is connected to the trunk port on a switch, can be used for routing for different VLANS on a switch.
No comments :
Post a Comment