InterVLAN Routing
R1:
conf t
int ge0/0/0
no ip address
no shut
exit
int ge 0/0/0.1 //creating subinterface
encapsulation dot1q 1 //setting the encapsulation to dot1q and assigning the int to vlan 1
ip address 192.168.1.1 255.255.255.0
exit
int ge 0/0/0.10 //creating subinterface
encapsulation dot1q 10 //setting the encapsulation to dot1q and assigning the int to vlan 10
ip address 192.168.10.1 255.255.255.0
exit
int ge 0/0/0.20 //creating subinterface
encapsulation dot1q 20 //setting the encapsulation to dot1q and assigning the int to vlan 20
ip address 192.168.20.1 255.255.255.0
exit
int ge 0/0/0.30 //creating subinterface
encapsulation dot1q 30 //setting the encapsulation to dot1q and assigning the int to vlan 30
ip address 192.168.30.1 255.255.255.0
exit
int ge 0/0/0.40 //creating subinterface
encapsulation dot1q 40 //setting the encapsulation to dot1q and assigning the int to vlan 40
ip address 192.168.40.1 255.255.255.0
exit
show ip int brief //check sub interfaces and assigned IPs
router eigrp 100
network 192.168.1.0
network 192.168.10.0
network 192.168.20.0
network 192.168.30.0
network 192.168.40.0
no auto-summary
exit
SW1:
conf t
int gi 0/1
switchport mode trunk //setting the int to trunk connected from R1 to pass all vlans to switch
exit
R2:
conf t
int ge0/0/0
no ip address
no shut
exit
int ge 0/0/0.1 //creating subinterface
encapsulation dot1q 1 //setting the encapsulation to dot1q and assigning the int to vlan 1
ip address 172.16.50.1 255.255.255.0
exit
int ge 0/0/0.10 //creating subinterface
encapsulation dot1q 10 //setting the encapsulation to dot1q and assigning the int to vlan 10
ip address 1172.16.60.1 255.255.255.0
exit
show ip int brief
router eigrp 100
network 172.16.50.0
network 172.16.60.0
no auto-summary
exit
SW4:
conf t
int gi 0/1
switchport mode trunk //setting the int to trunk connected from R2 to pass all vlans to switch
exit