Wednesday, September 15, 2010

Cisco command

STATIC ROUTE 

ip route (destination network) ( mac addres ) (out interface or ip )
Router(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.1
or
Router(config)#ip route 172.16.1.0 255.255.255.0 s0/0/0

===================
Change administrative distance for static route 

Router(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.1 200 ===> now we changed AD to 200

===================
Show command related to static route
Router#show ip route static ===> see all static routes
Router#show ip route ===> you can see all the static and dynamic route that u can access
====================
Default Route 

Router(config)#ip route 0.0.0.0 0.0.0.0 s0/0/0
=====================
RIPv1 CONFIGURATION

Router(config)#router rip 
Router(config-router)#network 192.168.1.0 ===> the direct connect network to my router 
Router(config-router)#passive-interface f0/0===> we will recieve update from f0/0 but will not send update to it
Router#debug ip rip  ===> to see rip updates
Router#show ip protocols ===> to make sure that rip is configured on ur router and running successfolly
=======================
RIPv2 CONFIGURATION
the same as ripv1

Router(config)#router rip 
Router(config-router)#network 192.168.1.0 ===> the direct connect network to my router 
Router(config-router)#passive-interface f0/0===> we will recieve update from f0/0 but will not send update to it
Router(config-router)#version 2 ===> we should do these command to active rip v2
=======================
OSPF CONFIGURATION
Router(config)#router ospf 10 ===> were 10 is proccess ip
Router(config-router)#network 10.1.1.2 0.0.0.0 area 0===> were 0.0.0.0 is the wild card mask & 10.1.1.2 is the direct connected network


========================
OSPF DR CONTROL 

1- changd interface ospf periority id 
Router(config)#int f0/0
Router(config-if)#ip ospf priority 255 


2- creat loopback interface 
Router(config)#int loopback 0
Router(config-if)#ip address 192.168.10.1 255.255.255.0 


3- change router id 
Router(config)#router ospf 1
Router(config-router)#router-id 192.168.10.10

===========================
OSPF Show Commands

Router#show ip ospf ===> see router id
Router#show ip route ospf ===> see ur ospf routes
Router#show ip ospf database 
Router#show ip ospf interface fastEthernet 0/0
Router#show ip ospf brief
Router#show ip ospf neighbor 
=========================
EIGRP Configuration 

Router(config)#router eigrp 1 ===> were autonomous system is 1
Router(config-router)#network 192.168.1.0==> direct connect Network
Router(config-router)#passive-interface f0/0==> no update will be send or recieved from fastethernet 0/0
Router(config-router)#no auto-summary 
========================
EIGRP Lood Balancing & Maximum hop count 

1- Load Balancing
Router(config)#router eigrp 1
Router(config-router)#maximum-path 6 ===> maximum 6


2- maximum hop count 
Router(config)#router eigrp 1
Router(config-router)#metric maximum-hops 20 ===>these mean that we can use only 19 router in network

=========================
EIGRP SHOW COMMANDS

Router#show ip route 
Router#show ip route eigrp 
Router#show ip eigrp neighbors
 Router#show ip eigrp topology 

=============================
Creat Vlan 

Switch#vlan database 
Switch(vlan)#vlan 2 name arabhardware                             ||                                Switch(vlan)#vlan 2 
===========================
Delete VLAN

Switch#vlan database 
Switch(vlan)#no vlan 2
===========================
Assign interface to vlan 

Switch(config)#int f0/1 ===> you can insert range if interfaces as the following command
Switch(config)#interface range fastEthernet 0/1 - 7
Switch(config-if)#switchport mode access 
Switch(config-if)#switchport access vlan 2
============================
Make the port trunk interface
Switch(config)#int f0/1
Switch(config-if)#switchport mode trunk 
Switch#show int trunk ===> u can see which vlan can communicat through these trunk 
===========================
Change Trunk Encapsulation  (802.1Q & ISL )
Switch(config)#int f0/1
Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport trunk encapsulation isl
==========================
Remove Vlan from Trunk Interface 


Switch(config)#int f0/1
Switch(config-if)#switchport trunk allowed vlan remove 2

========================
Change Native Vlan
 Switch(config)#int f0/1

Switch(config-if)#switchport trunk native vlan 2
=======================
Insert Ip To vlan
Switch(config)#interface vlan 2
Switch(config-if)#ip address 192.168.2.1 255.255.255.0
Switch(config-if)#no shutdown

===========================
Routing Between Vlans
Router(config)#int fastEthernet 0/1.1===> creat logical interface on the router that connected to switch with trunk connection
Router(config-subif)#encapsulation dot1Q 2===> these logical interface will be responsible for vlan 2 
Router(config-subif)#ip address 192.168.1.1 255.255.255.0===> we have to insert ip...its routing


Router(config)#int fastEthernet 0/1.2===> creat logical interface on the router that connected to switch with trunk connection
Router(config-subif)#encapsulation dot1Q 3===> these logical interface will be responsible for vlan 3 
Router(config-subif)#ip address 192.168.2.1 255.255.255.0===> we have to insert ip...its routing


Now Vlan 2 and vlan 3 can communicat successfully :D
==========================
insert ip in switch for Remote contol

Switch(config)#ip default-gateway 192.168.1.1

===========================
Add VTP Domain
Switch#vlan database 
Switch(vlan)#vtp domain portdream
===========================
Change vtp Mode to Client  or transparent

1- to client
Switch#vlan database
Switch(vlan)#vtp client 


2- to transparent
Switch#vlan database
Switch(vlan)#vtp transparent 

=========================
Show commands with vlan & vtp & spanning tree protocol



Switch#show vlan ===> see the available vtp on ur switch
Switch#show vtp status ===> every thing related to vtp===>u r client or transparent or server,revision number
Switch#show spanning-tree ===> u can see the Root bridge Switch and ur Bridge ID

=============================
Ethernet Channel 
( insert Range Of Interfaces to the same Ethernet Channel)
Switch(config)#int range fastEthernet 0/1 - 5
Switch(config-if-range)#channel-group 1 mode on ===> insert interfaces from 1 : 5 to channel 1 

============================
Enable Portfast 

Switch(config)#int fastEthernet 0/1
Switch(config-if)#spanning-tree portfast 

===========================
Port Security

1-Allow Just one Mac Address to access port f0/1
Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport port-security maximum 1
Switch(config-if)#switchport port-security violation shutdown 
Switch(config-if)#switchport port-security mac-address H.H.H===> were H.H.H Is ur mac Address


2- you can insert sticky mac address===> the first mac address connected to port is the only allowed mac address

Switch(config)#interface fastEthernet 0/1
Switch(config-if)#switchport port-security maximum 1
Switch(config-if)#switchport port-security violation shutdown 
Switch(config-if)#switchport port-security mac-address sticky


================================
Change Bridge Id For Specific Vlan To Make the Switch Root Bridge 

1- by specify Periority number
Switch(config)#spanning-tree vlan 1 priority 0 ===> the lowest priority is better to be RB :D

2- or by these command 
Switch(config)#spanning-tree vlan 1 root primary 

===============================
Enable BPDU Guard & BPDU Filter 
(We usually use it with Portfast command)

Switch(config)#int fastEthernet 0/1
Switch(config-if)#spanning-tree portfast 
Switch(config-if)#spanning-tree bpduguard enable 
Switch(config-if)#spanning-tree bpdufilter enable 

===============================
Enable BackboneFast & Uplinkfast & Rapid STP

Switch(config)#int fastEthernet 0/1
Switch(config-if)#spanning-tree backbonefast
Switch(config-if)#spanning-tree uplinkfast
Switch(config-if)#spanning-tree mode rqpid-pust ===> im not sure about these command...i didnt test it 

============================
Insert Static mac Address To specific Vlan  & interface 
Switch(config)#mac-address-table static 00e0.f7a9.8d1c vlan 1 interface fastEthernet 0/1

No comments:

Post a Comment