You are on page 1of 8

Router General Configuration

==================

Router(config)# hostname BR1 for changing the name of router/hostname

Router> en
Router# config t
Router(config)# interface fastEthernet 0/0
Router(config-if)# ip address 192.168.1.1 255.255.255.128
Router(config-if)# no shut
Router(config-if)# exit

Router(config)# interface fastEthernet 0/1


Router(config-if)# ip address 192.168.1.129 255.255.255.240
Router(config-if)# no shut
Router(config-if)# exit

Router(config)# interface serial 0/0/0


Router(config-if)# ip address 192.168.3.1 255.255.255.252
Router(config-if)# no shut
Router(config-if)# clock rate 64000
Router(config-if)# exit

PASSWORDS

For line console setup password:


=====================
BR1(config)# line console 0
BR1(config-line)# password cisco
BR1(config-line)# login
BR1(config-line)# exit
====================
For virtual terminal console/remote computer setup password:
=============================================
BR1(config)# line vty 0 4
BR1(config-line)# password cisco
BR1(config-line)# login
BR1(config-line)# exit

For privileged Mode password


=============================================
BR1(config)# enable password obc40.// To Disable: no enable password
BR1(config)# enable secret obc40//over lapped previous one

BR1(config)# service password-encryption for encrypt all password.


General Commands
=============================

BR1# show running-config To see the current configuration.


BR1#copy running-config startup-config for saving configurations in NVRAM.
BR1#copy running-config tftp:-? For saving the configuration in tftp Address or name of remote host []?
192.168.1.130(servers IP address)

BR1# erase startup config. erasing all info. //Copy before to this
BR1# reload.

SSH CONFIGURATION
=============================
Router(config)#hostname ArmyHQ
ArmyHQ(config)#ip domain-name army.net
ArmyHQ(config)#username fahmid password fahmid //no need
ArmyHQ(config)#crypto key generate rsa -> The name for the keys will be: ArmyHQ.army.net
ArmyHQ(config)#How many bits in the modulus [512]: 1048
ArmyHQ(config)#ArmyHQ(config)#ip ssh version 2
ArmyHQ(config)#line vty 0 4
ArmyHQ(config-line)#transport input ssh
ArmyHQ(config-line)#password eew
ArmyHQ(config-line)#login local
ArmyHQ(config-line)#exit

// To connect from PC with SSH


PC> ssh l fahmid 192.168.10.193 // password is vty password

FOR INTERNAL CONNECTION OF ROUTERS

BR1#show ip protocols

Default Routing

Router(config)# ip route 0.0.0.0 0.0.0.0 serial 0/0/0

Static Routing

ip route destination_network destination_network_subnet_mask exit_interface

Router(config)# ip route 172.16.32.0 255.255.240.0 172.16.48.2


RIP

Hop count ( where there is less number of hop)

BR1#show ip route
BR1(config)#router rip
BR1(config-router)#version 2
BR1(config-router)#network 172.16.1.0
BR1(config-router)#network 172.16.2.140
BR1(config-router)#network 172.16.2.144
BR1(config-router)#passive interface gi 0/1// So restrict 30 secd packet to the port
BR1(config-router)#no auto-summary

EIGRP
=======
BR1#show ip route
BR1(config)#router eigrp 1
BR1(config-router)#network 172.16.1.0 0.0.0.255
BR1(config-router)#network 172.16.2.0 0 0.0.0.255
BR1(config-router)#network 172.16.3.0 0 0.0.0.255
BR1(config-router)#passive interface gi 0/1 // So restrict 30 secd packet to the port
BR1(config-router)#no auto-summary

BR1#show ip eigrp neighbor


BR1#show ip eigrp topology
BR1#show ip interface brief
OSPF
=======

R1(config)#router ospf 1
R1(config-router)# network 172.16.1.32 0.0.0.7 area 0
R1(config-router)# network 192.168.10.4 0.0.0.3 area 0
R1(config-router)# network 192.168.10.8 0.0.0.3 area 0

R1# Show ip protocols // To show router id

Router(config)#router ospfprocess-id //??


Router(config-router)# router-id 1.1.1.1// Set router id
Router#clear ip ospf process// clear router id
Router# show ip ospf neighbor
Router#show ip protocols
Router#show ip ospf
Router#show ip ospf interface serial 0/0/0 // view the cost

R1(config)#interface serial 0/0/0


R1(config-if)#ip ospf cost 1562

FRAME _RELAY

R1(config)#int se 2/0
R1(config-if)#no ip address
R1(config-if)#encapsulation frame-relay
R1(config-if)#no shutdown

R1(config-if)#interface Serial2/0.102 point-to-point


R1(config-subif)#frame-relay interface-dlci 102
R1(config-subif)#description Frame-Relay Connection to R2

R1(config-subif)# ip address 10.0.0.1 255.255.255.252

r2(config)#in se 2/0
r2(config-if)#no ip address
r2(config-if)#encapsulation frame-relay
r2(config-if)#no shutdown
r2(config-if)#interface Serial2/0.201 point-to-point
r2(config-subif)#frame-relay interface-dlci 201
r2(config-subif)#description Frame-Relay Connection to R1
r2(config-subif)#ip address 10.0.0.2 255.255.255.252

Redistribution

!inside ospf
redistribute eigrp 10 subnets
redistribute static subnets
redistribute rip subnets

!inside eigrp
redistribute ospf 1 metric 10000 100 255 1 1500
redistribute static metric 10000 1 255 1 1500
redistribute rip metric 10000 1 255 1 1500

!inside rip
redistribute ospf 1 metric 1
redistribute eigrp 10 metric 1
redistribute satic

CHAP

R0(config)#interface Serial6/0

R0(config-if)#encapsulation ppp

R0(config-if)#ppp authentication chap

R0(config)#username R12 password cisco123


SWITCH
(config)no ip domain-lookup //to restrict wrong commands error / ctrl+alt+6

VTP:

TO SERVER
Switch>enable
Switch#configure terminal
Switch(config)#hostname S1
S1(config)#vtp domain example
S1(config)#vtp password vinita

TO CLIENT
Switch>enable
Switch#configure terminal
Switch(config)#hostname S2
S2(config)#vtp mode client
S2(config)#vtp domain example
S2(config)#vtp password Vinita

Switch>enable
Switch#configure terminal
Switch(config)#hostname S3
S3(config)#vtp mode client
S3(config)#vtp domain example
S3(config)#vtp password vinita

To configure VTP

S1(config)#interface fastEthernet 0/24


S1(config-if)#switchport mode trunk
S1(config-if)#exit
S1(config)#interface gigabitEthernet 1/1
S1(config-if)#switchport mode trunk
S1(config-if)#exit
S1(config)#interface gigabitEthernet 1/2
S1(config-if)#switchport mode trunk
{same to s2 and s3 where necessary}
VLAN

S1(config)#vlan 10
S1(config-vlan)#exit
S1(config)#vlan 20
S1(config-vlan)#exit
S1(config)#
S1(config)#interface fastEthernet 0/1
S1(config)#sw mode access
S1(config-if)#switchport access vlan 10
S1(config-if)#interface fastEthernet 0/2
S1(config-if)#switchport access vlan 20
INTER VLAN ROUTING

Router

hostname R1
!
interface fastEthernet0/0.10
encapsulation dot1Q 10
ip address 192.168.10.254 255.255.255.0
!
interface fastEthernet0/0.20
encapsulation dot1Q 20
ip address 192.168.20.254 255.255.255.0
!
End

Switch

hostname SW1
!
interface fastEthernet0/1
switchport mode access
switchport access vlan 10
!
interface fastEthernet0/2
switchport mode access
switchport access vlan 20
!
interface fastEthernet0/3
switchport trunk encapsulation dot1q
switchport mode trunk
switchport trunk allowed vlan 10,20
end

You might also like