!assigning hostname to router hostname R2 !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 R2 and password as it will need it for authentication to !establish a link to R1 username R1 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 alanR2.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 none 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 ! !configuring int g0/0 int g0/0 ip address 10.111.9.1 255.255.255.0 !configuring acl on interface ip access-group 101 in !disabling cdp on the int no cdp enable no shut ! !assigning ip to s0/0/0 int s0/0/0 encapsulation ppp ppp authentication chap ip address 10.111.0.14 255.255.255.252 !disabling cdp on the int no cdp enable no shut ! !setting up OSPF router ospf 1 !assigning the router an OSPF ID router-id 2.2.2.2 !summarising the ospf area area 3 range 10.111.9.0 255.255.255.0 !adding the networks to advertise network 10.111.0.12 0.0.0.3 area 0 network 10.111.9.0 0.0.0.255 area 3 !stopping advertisements being sent out on interface passive-interface g0/0 ! !acl for this router !stops traffic from 10.111.9.0/24 accessing internal network. access-list 101 deny ip 10.111.9.0 0.0.0.255 10.111.0.0 0.0.255.255 !stops traffic from 10.111.9.0/24 accessing internal network using global ips access-list 101 deny ip 10.111.9.0 0.0.0.255 202.100.37.0 0.0.0.255 !allows everything else access-list 101 permit ip any any ! !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 !