!assigning hostname to router hostname R1 !banner message banner motd #Unauthorized access to this device is prohibited!# ! !configuring aaa authentication on the router aaa new-model aaa authentication login default local ! !creating a username for R1 and password as it will need it for authentication to !establish a link to R2 username R2 password kelly ! !setting ssh to use version 2 only ip ssh version 2 ! !disabling dns lookup no ip domain-lookup ! !creating a domain name for ssh. this is used to generate the key ip domain-name alanR1.com ! !generating ssh keys crypto key generate rsa 1024 ! !preventing messages interrupting CLI on console connection line con 0 logging synchronous ! ! disabling aux connection line aux 0 transport output ssh no exec exec-timeout 0 1 no password ! !preventing messages interrupting CLI on all vty connections line vty 0 15 !allowing traffic in the acl access-class 1 in logging synchronous !enabling only ssh on the vty connections transport input ssh ! !assigning ip to s0/0/0 interface Serial0/0/0 ip address 10.111.0.10 255.255.255.252 no cdp enable no shut ! !configuring this int for NAT as traffic from this Int if from inside the network ip nat inside no shut ! !assigning ip to s0/0/1 interface Serial0/0/1 ip address 10.111.0.18 255.255.255.252 !configuring this int for NAT as traffic from this Int if from inside the network ip nat inside !disabling cdp on the int no cdp enable no shut ! !assigning ip to s0/1/0 interface Serial0/1/0 ip address 10.111.0.13 255.255.255.252 ! !changing the encapsulation to PPP and setting authentication on this interface encapsulation ppp ppp authentication chap !configuring this int for NAT as traffic from this Int if from inside the network ip nat inside !disabling cdp on the int no cdp enable no shut ! !assigning ip to s0/1/1 interface Serial0/1/1 ip address 196.1.1.42 255.255.255.252 !configuring this int for NAT as traffic from this Int is from outside the network ip nat outside !disabling cdp on the int no cdp enable no shut ! !setting up OSPF router ospf 1 !assigning the router an OSPF ID router-id 1.1.1.1 !summarising the ospf area area 0 range 10.111.0.0 255.255.255.0 !adding the networks to advertise network 10.111.0.8 0.0.0.3 area 0 network 10.111.0.16 0.0.0.3 area 0 network 10.111.0.12 0.0.0.3 area 0 !propagating the default route through the network default-information originate ! !configuring nat with the public ip address range ip nat pool public_access 202.100.37.2 202.100.37.254 netmask 255.255.255.0 !configuring what ip address will be translated with NAT ip nat inside source list 1 pool public_access !configuring a static ip on web server ip nat inside source static 10.111.1.253 202.100.37.1 ! !default route to ISP ip route 0.0.0.0 0.0.0.0 Serial0/1/1 ! !ssh access list only devices from the internal network can ssh into device because !of below acl access-list 1 permit 10.111.0.0 0.0.255.255 ! !assigning as password and username to the router username alan secret kelly !configuring a password on privileged mode enable secret kelly ! !end end !copy running config to startup config copy r s