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

Configuration

This document provides configuration examples for basic router and switch configurations including changing the hostname, setting passwords, configuring interfaces, routing protocols like RIP, EIGRP, OSPF, VLAN configuration, DHCP, and subinterfaces. The configurations cover topics such as interface IP addresses, routing protocols, VLAN creation, switchport modes, and more.

Uploaded by

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

Configuration

This document provides configuration examples for basic router and switch configurations including changing the hostname, setting passwords, configuring interfaces, routing protocols like RIP, EIGRP, OSPF, VLAN configuration, DHCP, and subinterfaces. The configurations cover topics such as interface IP addresses, routing protocols, VLAN creation, switchport modes, and more.

Uploaded by

elias ferhan
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

///////Change hostname

Router(config)#hostname IT

///////Save running configuration


IT#copy run start

Router#copy running-config startup-config

///////To restart
IT#reload

///Create enable password


Router(config)#enable password it

///////To remove enable secret password


Router(config)#no enable password

///////To enable secret password


Router(config)#enable secret cs

///////Protect console port


Router(config)#line console 0

Router(config-line)#password csit

Router(config-line)#login
///////Interface configuration
R1(config)#interface fastethernet 0/0

R1(config-if)#ip address 192.168.1.1 255.255.255.0

R1(config-if)#no shutdown

///////Serial interface configuration


Router(config)#int se0/0/0

Router(config-if)#ip address 10.10.10.2 255.0.0.0

Router(config-if)#clock rate 64000

Router(config-if)#no sh

/////// DHCP configuration


Router(config)#ip dhcp pool it

Router(dhcp-config)#network 192.168.10.0 255.255.255.0

Router(dhcp-config)#default-router 192.168.10.1

///////Exclud IP
Router(config)#ip dhcp excluded-address 192.168.10.2 192.168.10.5

///////Static route
router1(config)#ip route 192.168.20.0 255.255.255.0 10.10.10.2

or

Router(config)#ip route 192.168.10.0 255.255.255.0 se0/0/0 ---current router interface

///////Remove static route config


Router(config)#no ip route 192.168.10.0 255.255.255.0 se0/0/0

or
Router(config)#no ip route 192.168.20.0 255.255.255.0 10.10.10.2

///////Default route
Router(config)#ip route 0.0.0.0 0.0.0.0 10.10.10.1

or

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

///////Telnet
router1(config)#enable secret 123

router1(config)#line vty 0 4

router1(config-line)#password 111

router1(config-line)#login

///////ssh
Router(config)# hostname it

Router(config)#ip domain-name it.com

Router(config)#username it password it.com

Router(config)#crypto key generate rsa

it(config)#crypto key generate rsa

it(config)#line vty 0 10

it(config-line)#login local

it(config-line)#transport input ssh

pc: ssh -l username ip


///////RIP configuration
router1(config)#router rip

router1(config-router)#network 192.168.10.0

router1(config-router)#network 10.0.0.0

///////RIP V2
Router(config)#router rip

Router(config-router)#version 2

Router(config-router)#network 192.168.30.0

Router(config-router)#network 20.0.0.0

///remove rip
router1(config)#no route rip

or

router1(config)#no route rip 192.168.10.0

///////EIGRP configuration//////

Router(config)#router eigrp 1

Router(config-router)#network 192.168.10.0 0.0.0.255

Router(config-router)#network 10.0.0.0 0.255.255.255

Router(config-router)#no auto-summary

Router(config-router)#redistribute eigrp 1

Router(config)#ip route 0.0.0.0 0.0.0.0 se0/0/1

///////To remove EIGRP routing


Router(config)#router eigrp 1

Router(config-router)#no route eigrp 1


///////OSPF configuration
Router(config)#router ospf 1

Router(config-router)#network 30.0.0.0 0.255.255.255 area 0

Router(config-router)#network 30.0.0.0 0.255.255.255 area 0

Router(config-router)#network 192.168.40.0 0.0.0.255 area 0

///////vlan ceration
Switch(config)#vlan 2

Switch(config-vlan)#name it

///////join intrface to vlan

Switch(config)#int fa0/2

Switch(config-if)#switchport access vlan 2

Switch(config)#interface range fa0/5-fa0/10

///////remove intrface from vlan


Switch(config)#int fa0/2

Switch(config-if)#no switchport access vlan 2

///////remove vlan
Switch(config)#no vlan 2

///////router intface configuration and dhcp


Router(config)#int fa0/0

Router(config-if)#ip address 192.168.20.1 255.255.255.0

Router(config-if)#no sh

Router(config)#int fa0/0

Router(config-if)#ip address 192.168.10.1 255.255.255.0


Router(config)#ip dhcp pool it

Router(dhcp-config)#network 192.168.20.0 255.255.255.0

Router(dhcp-config)#default-router 192.168.20.1

Router(config)#ip dhcp pool cs

Router(dhcp-config)#network 192.168.10.0 255.255.255.0

Router(dhcp-config)#default-router 192.168.10.1

///////switch config accass port


Switch(config-vlan)#int fa0/4...to computer

Switch(config-if)#switchport access vlan 2

Switch(config-vlan)#int fa0/3...to router

Switch(config-if)#switchport access vlan 2

Switch(config)#vlan 3

Switch(config-vlan)#int fa0/5...to computer

Switch(config-if)#switchport access vlan 3

Switch(config)#int fa0/2----to router

Switch(config-if)#switchport access vlan 3

/////// Trunk port


Switch(config-if)#switchport mode trunk

Router(config)#int fa0/0

Router(config-if)#no ip address
Router(config-if)#no sh

Router(config)#int fa0/0.10

Router(config-subif)#encapsulation dot1q 10

Router(config-subif)#ip address 192.168.10.1 255.255.255.0

Router(config)#int fa0/0.20

Router(config-subif)#encapsulation dot1q 20

Router(config-subif)#ip address 192.168.20.1 255.255.255.0

You might also like