en
conf t
hostname R1
line vty 0 4
password cisco
login
exit
enable password cisco
inter s1/1
ip add 172.16.1.1 255.255.255.0
no sh
exit
ip add 172.16.5.1 255.255.255.0
no sh
network 172.16.0.0
en
conf t
hostname R2
line vty 0 4
password cisco
login
exit
enable password cisco
inter s1/0
ip add 172.16.1.2 255.255.255.0
no sh
exit
inter s1/1
ip add 172.16.2.1 255.255.255.0
no sh
exit
inter s1/2
ip add 172.16.3.1 255.255.255.0
no sh
en
conf t
hostname R3
line vty 0 4
password cisco
login
exit
enable password cisco
inter s1/0
ip add 172.16.2.2 255.255.255.0
no sh
exit
inter s1/2
ip add 172.16.4.1 255.255.255.0
no sh
en
conf t
hostname R4
line vty 0 4
password cisco
login
exit
enable password cisco
inter s1/3
ip add 172.16.4.2 255.255.255.0
no sh
exit
inter s1/2
ip add 172.16.3.2 255.255.255.0
no sh
exit
inter s1/1
ip add 172.16.5.2 255.255.255.0
no sh
ospf:
r1:
router ospf 100
network 172.16.1.1 0.0.0.0 area 0
network 172.16.5.1 0.0.0.0 area 0
router ospf 101
network 172.16.1.2 0.0.0.0 area 0
network 172.16.2.1 0.0.0.0 area 0
network 172.16.3.1 0.0.0.0 area 0
r3:
router ospf 102
network 172.16.2.2 0.0.0.0 area 0
network 172.16.4.1 0.0.0.0 area 0
router ospf 103
network 172.16.5.2 0.0.0.0 area 0
network 172.16.4.2 0.0.0.0 area 0
network 172.16.3.2 0.0.0.0 area 0
vlan database
vlan 2 name ccna2
vlan 3 name ccna3
conf t
inter fa1/11
switchport mode access
switchport access vlan 1
exit
inter fa1/12
switchport mode access
switchport access vlan 2
exit
inter fa1/5
switchport mode trunk
R1:
conf t
interf fa0/0
no ip add
interf fa0/0.1
ip add 192.168.1.1 255.255.255.0
encapsulation dot1Q 1
exit
interf fa0/0.2
ip add 192.168.2.1 255.255.255.0
encapsulation dot1Q 2
switchport mode access
switchport access vlan 2