0% found this document useful (0 votes)
5 views

Script Class LAB (17-4-2024)

The document describes the configuration of three routers (Router A, Router B, Router C) and a DHCP server. Each router and the DHCP server are configured with interfaces, IP addresses, routing, user access, and other settings. Event manager applets are configured on Router A to manage the state of one of its interfaces.

Uploaded by

Tamoor Baig
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Script Class LAB (17-4-2024)

The document describes the configuration of three routers (Router A, Router B, Router C) and a DHCP server. Each router and the DHCP server are configured with interfaces, IP addresses, routing, user access, and other settings. Event manager applets are configured on Router A to manage the state of one of its interfaces.

Uploaded by

Tamoor Baig
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 9

----------------------- 3-Router and Router-A is DHCP ---------------------------

-------------------------------- Router-A Config ----------------------------------

en
conf t
hostname Router-A
clock timezone PST 5

banner motd #
----------------------------- Hello! Wellcome-To Router-A Topology
----------------------
==>>> Just Below User Access the Network.
1) admin
-----------------------------------------------------------------------------------
-#

banner login #
===>>> Just Valid User Login Now! ---
#

!----------------->>>>>>>>>> User-Configuration.

username admin privilege 15 password cisco

enable secret cisco

!------------------------- Line Console 0- Configuration.

line cons 0
password cisco
login local
do wr
exit

!------------------------ Line VTY Configuration.

line vty 0 4
password cisco
login local
transport input ssh
do wr
exit

!-------------------------- >>> Interface FastEthernet0/0

int fa0/0
no shutdown
desc ====>>>> Router-A LAN Network.
ip address 192.5.1.1 255.255.255.0
ipv6 enable
ipv6 address fd01::1/64
ip helper-address 8.0.0.2
ip helper-address 9.0.0.2
do wr
exit

!---------------------------- >>> Interface Serial 0/0/0


int ser0/0/0
no shutdown
keepalive 10
encap hdlc
clock rate 4000000
desc ====>>>Router-C Port.
ip address 7.0.0.2 255.0.0.0
ipv6 enable
ipv6 address 2005::1/64
do wr
exit

!---------------------------- >>> Interface Serial 0/0/1

int ser0/0/1
no shutdown
keepalive 10
encap hdlc
clock rate 4000000
desc ====>>>Router-B Port.
ip address 5.0.0.1 255.0.0.0
ipv6 enable
ipv6 address 2000::1/64
do wr
exit

!---------------------------- >>> Interface Serial 0/1/0

int ser0/1/0
no shutdown
keepalive 10
encap hdlc
clock rate 4000000
desc ====>>>> DHCP-S Port.
ip address 8.0.0.1 255.0.0.0
ipv6 enable
ipv6 address 2006::1/64
do wr
exit

!---------------------------- >>> Interface Serial 0/1/1

!int ser0/1/1
!no shutdown
!keepalive 10
!encap hdlc
!clock rate 4000000
!desc ===>>> DHCP-S Connected Port.
!ip address 9.0.0.1 255.0.0.0
!ipv6 enable
!ipv6 address 2008::1/64
!do wr
!exit

!---------------------------- >>> Interface Serial 0/1/1 for DOWN-State (EEM)

event manager applet ser0/1/1-Admin-Down


event syslog pattern "Interface Serial0/1/1, changed state to administratively
down" period 1
action 1.0 cli command "enable"
action 2.0 cli command "config terminal"
action 3.0 cli command "interface ser0/1/1"
action 4.0 cli command "no shutdown"
action 5.0 cli command "keepalive 10"
action 6.0 cli command "encap hdlc"
action 7.0 cli command "clock rate 4000000"
action 8.0 cli command "desc ===>>> DHCP-S Connected Port."
action 9.0 cli command "ip address 9.0.0.1 255.0.0.0"
action 10.0 cli command "ipv6 enable"
action 11.0 cli command "ipv6 address 2008::1/64"
action 12.0 cli command "ip route 6.0.0.0 255.0.0.0 ser0/0/1"
action 13.0 cli command "ip route 6.0.0.0 255.0.0.0 ser0/0/0"
action 14.0 cli command "ip route 192.5.2.0 255.255.255.0 ser0/0/1"
action 15.0 cli command "ip route 192.5.2.0 255.255.255.0 ser0/0/0 5"
action 16.0 cli command "ip route 192.5.3.0 255.255.255.0 ser0/0/0"
action 17.0 cli command "ip route 192.5.3.0 255.255.255.0 ser0/0/1 5"
action 18.0 cli command "do write"
action 19.0 syslog msg "BackUp Port Save Your Life.. Serial0/1/1 is UP."
exit

!---------------------------- For UP-State (EEM)


event manager applet ser0/1/1-Admin-Up
event syslog pattern "Interface Serial0/1/1, changed state to up" period 1
action 1.0 cli command "enable"
action 2.0 cli command "config terminal"
action 3.0 cli command "interface ser0/1/1"
action 4.0 cli command "shutdown"
action 5.0 cli command "no keepalive 10"
action 6.0 cli command "no encap hdlc"
action 7.0 cli command "no clock rate 4000000"
action 8.0 cli command "desc ===>>> DHCP-S Connected Port."
action 9.0 cli command "no ip address 9.0.0.1 255.0.0.0"
action 10.0 cli command "no ipv6 enable"
action 11.0 cli command "no ipv6 address 2008::1/64"
action 12.0 cli command "no ip route 6.0.0.0 255.0.0.0 ser0/0/1"
action 13.0 cli command "no ip route 6.0.0.0 255.0.0.0 ser0/0/0"
action 14.0 cli command "no ip route 192.5.2.0 255.255.255.0 ser0/0/1"
action 15.0 cli command "no ip route 192.5.2.0 255.255.255.0 ser0/0/0 5"
action 16.0 cli command "no ip route 192.5.3.0 255.255.255.0 ser0/0/0"
action 17.0 cli command "no ip route 192.5.3.0 255.255.255.0 ser0/0/1 5"
action 18.0 cli command "do write"
action 19.0 syslog msg "Your Life is Save .. Serial0/1/1 is Back."
exit

!---------------------------- >>> IP-Route on Router-A

ip route 6.0.0.0 255.0.0.0 ser0/0/0


ip route 6.0.0.0 255.0.0.0 ser0/0/1 5
ip route 192.5.2.0 255.255.255.0 ser0/0/1
ip route 192.5.2.0 255.255.255.0 ser0/0/0 5
ip route 192.5.3.0 255.255.255.0 ser0/0/0
ip route 192.5.3.0 255.255.255.0 ser0/0/1 5
ip route 192.5.4.0 255.255.255.0 ser0/1/0
do wr

!----------------->>>>>>>>>> Configuring SSH of Router-A


ip domain-name corvit.com
cry key gen rsa

-------------------------------- Router-B Config ----------------------------------

en
conf t
hostname Router-B
clock timezone PST 5

banner motd #
----------------------------- Hello! Wellcome-To Router-B Topology
----------------------
==>>> Just Below User Access the Network.
1) admin
-----------------------------------------------------------------------------------
-#

banner login #
===>>> Just Valid User Login Now! ---
#

!----------------->>>>>>>>>> User-Configuration.

username admin privilege 15 password cisco

enable secret cisco

!------------------------- Line Console 0- Configuration.

line cons 0
password cisco
login local
do wr
exit
s
!------------------------ Line VTY Configuration.

line vty 0 4
password cisco
transport input ssh
login local
do wr
exit

!-------------------------- >>> Interface FastEthernet0/0

int fa0/0
no shutdown
desc ====>>>> Router-B LAN Network.
ip address 192.5.2.1 255.255.255.0
ipv6 enable
ipv6 address fd02::1/64
do wr
exit
!---------------------------- >>> Interface Serial 0/0/0

int ser0/0/0
no shutdown
keepalive 10
encap hdlc
clock rate 4000000
desc ====>>>> Router-C Connected Port.
ip address 6.0.0.1 255.0.0.0
ipv6 enable
ipv6 address 2002::1/64
do wr
exit

!---------------------------- >>> Interface Serial 0/0/1

int ser0/0/1
no shutdown
keepalive 10
encap hdlc
clock rate 4000000
desc ====>>>> Router-A Connected Port.
ip address 5.0.0.2 255.0.0.0
ipv6 enable
ipv6 address 2001::1/64
do wr
exit

!---------------------------- >>> IP-Route on Router-B

ip route 7.0.0.0 255.0.0.0 ser0/0/0


ip route 7.0.0.0 255.0.0.0 ser0/0/1
ip route 192.5.1.0 255.255.255.0 ser0/0/1
ip route 192.5.1.0 255.255.255.0 ser0/0/0 5
ip route 192.5.3.0 255.255.255.0 ser0/0/0
ip route 192.5.3.0 255.255.255.0 ser0/0/1 5
ip route 192.5.4.0 255.255.255.0 ser0/0/1
ip route 192.5.3.0 255.255.255.0 ser0/0/0 5
do wr

!----------------->>>>>>>>>> Configuring SSH of Router-B

ip domain-name corvit.com
cry key gen rsa

-------------------------------- Router-C Config ----------------------------------

en
conf t
hostname Router-C
clock timezone PST 5

banner motd #
----------------------------- Hello! Wellcome-To Router-C Topology
----------------------
==>>> Just Below User Access the Network.
1) admin
-----------------------------------------------------------------------------------
-#

banner login #
===>>> Just Valid User Login Now! ---
#

!----------------->>>>>>>>>> User-Configuration.

username admin privilege 15 password cisco

enable secret cisco

!------------------------- Line Console 0- Configuration.

line cons 0
password cisco
login local
do wr
exit

!------------------------ Line VTY Configuration.

line vty 0 4
password cisco
login local
do wr
exit

!-------------------------- >>> Interface FastEthernet0/0

int fa0/0
no shutdown
desc ====>>>> Router-C LAN Network.
ip address 192.5.3.1 255.255.255.0
ipv6 enable
ipv6 address fd03::1/64
do wr
exit

!---------------------------- >>> Interface Serial 0/0/0

int ser0/0/0
no shutdown
keepalive 10
encap hdlc
clock rate 4000000
desc ====>>>> Router-B Connected Port.
ip address 6.0.0.2 255.0.0.0
ipv6 enable
ipv6 address 2003::1/64
do wr
exit

!---------------------------- >>> Interface Serial 0/0/1

int ser0/0/1
no shutdown
keepalive 10
encap hdlc
clock rate 4000000
desc ====>>>> Router-A Connected Port.
ip address 7.0.0.1 255.0.0.0
ipv6 enable
ipv6 address 2004::1/64
do wr
exit

!---------------------------- >>> IP-Route on Router-C

ip route 5.0.0.0 255.255.255.0 ser0/0/0


ip route 5.0.0.0 255.255.255.0 ser0/0/1
ip route 192.5.1.0 255.255.255.0 ser0/0/0
ip route 192.5.1.0 255.255.255.0 ser0/0/1 5
ip route 192.5.2.0 255.255.255.0 ser0/0/0 5
ip route 192.5.2.0 255.255.255.0 ser0/0/1
ip route 192.5.4.0 255.255.255.0 ser0/0/0
ip route 192.5.4.0 255.255.255.0 ser0/0/1 5
do wr

-------------------------------- DHCP-S Config ----------------------------------

en
conf t
hostname DHCP-S
clock timezone PST 5

banner motd #
----------------------------- Hello! Wellcome-To DHCP-Server Topology
----------------------
==>>> Just Below User Access the Network.
1) admin
-----------------------------------------------------------------------------------
-#

banner login #
===>>> Just Valid User Login Now! ---
#

!----------------->>>>>>>>>> User-Configuration.

username admin privilege 15 password cisco

enable secret cisco

!------------------------- Line Console 0- Configuration.

line cons 0
password cisco
login local
do wr
exit

!------------------------ Line VTY Configuration.


line vty 0 4
password cisco
transport input ssh
login local
do wr
exit

!-------------------------- >>> Interface FastEthernet0/0

int fa0/0
no shutdown
desc ====>>>> DHCP-S LAN Network.
ip address 192.5.4.1 255.255.255.0
ipv6 enable
ipv6 address fd04::1/64
do wr
exit

!---------------------------- >>> Interface Serial 0/1/0

int ser0/1/0
no shutdown
keepalive 10
encap hdlc
clock rate 4000000
desc ===>>> Router-A Connected Port.
ip address 8.0.0.2 255.0.0.0
ipv6 enable
ipv6 address 2007::1/64
do wr
exit

!---------------------------- >>> Interface Serial 0/1/1

int ser0/1/1
no shutdown
keepalive 10
encap hdlc
clock rate 4000000
desc ===>>> Router-A Connected Port.
ip address 9.0.0.2 255.0.0.0
ipv6 enable
ipv6 address 2009::1/64
do wr
exit

!---------------------------- >>> IP-Route on DHCP-Server.

ip route 5.0.0.0 255.0.0.0 ser0/1/0


ip route 6.0.0.0 255.0.0.0 ser0/1/0
ip route 7.0.0.0 255.0.0.0 ser0/1/0
ip route 192.5.1.0 255.255.255.0 ser0/1/0
ip route 192.5.2.0 255.255.255.0 ser0/1/0
ip route 192.5.3.0 255.255.255.0 ser0/1/0

!-------------------------- >>>>> IP-DHCP Excluded-address.

ip dhcp excluded-address 192.5.1.1 192.5.1.5


ip dhcp excluded-address 192.5.1.254
ip dhcp excluded-address 192.5.2.1 192.5.2.5
ip dhcp excluded-address 192.5.2.254
ip dhcp excluded-address 192.5.3.1 192.5.3.5
ip dhcp excluded-address 192.5.3.254
ip dhcp excluded-address 192.5.4.1 192.5.4.5
ip dhcp excluded-address 192.5.4.254
do wr

!-------------------------- >>>>> IP-Pool For Router-A LAN Network.

ip dhcp pool Pool-RA_LAN.


network 192.5.1.0 255.255.255.0
default-router 192.5.1.1
dns-server 192.5.4.254
! lease 0 0 15
do wr
exit

!-------------------------- >>>>> IP-Pool For Router-B LAN Network.

ip dhcp pool Pool-RB_LAN.


network 192.5.2.0 255.255.255.0
default-router 192.5.2.1
dns-server 192.5.4.254
! lease 0 0 15
do wr
exit

!-------------------------- >>>>> IP-Pool For Router-C LAN Network.

ip dhcp pool Pool-RC_LAN.


network 192.5.3.0 255.255.255.0
default-router 192.5.3.1
dns-server 192.5.4.254
! lease 0 0 15
do wr
exit

!-------------------------- >>>>> IP-Pool For DHCP-S LAN Network.

ip dhcp pool Pool-RA_LAN.


network 192.5.4.0 255.255.255.0
default-router 192.5.4.1
dns-server 192.5.4.254
! lease 0 0 15
do wr
exit

!----------------->>>>>>>>>> Configuring SSH of DHCP-Server

ip domain-name corvit.com
cry key gen rsa

You might also like