You are on page 1of 41

Snooping de DHCP. Se configura el switch donde est el servidor DHCP. ip dhcp snooping.

dhcp snooping dhcp snooping vlan X

En la interface (numero de puerto) donde se conecta el linux


interface Fa 0/Y ip dhcp snooping trusted

y si hay ms switches conectados a ste es importante


ip dhcp relay information trusted

A la interface VLAN donde esta el servidor DHCP, si no el pinche suichi no hara relay de los paquetes de DHCP.

Si un dispositivo malicioso de un puerto no confiable intenta enviar un paquete de respuesta de DHCP a la red, el puerto se desactiva.

Nov 22 2008 12:56PM GMT

How to configure DHCP Snooping in a Cisco Catalyst Switches.


Posted by: Yasir Irfan Networking, DHCP, Switches, Cisco, Switching, Routing and Switching, CCNP, Cisco IOS, Cisco 2960, Cisco 2950, HSRP, Cisco 6500, Cisco Tips, Cisco 3560, Cisco Learning, Server Security, Cisco 3750-E, Cisco 3560-E, IOS commands, Cisco Systems, Cisco 6500 Series Catalyst Switch, Cisco 6503, Cisco Catalyst 6503-E Switch, Cisco Catalyst 6506-E Switch, Cisco Catalyst 6509-V-E Switch, Cisco Catalyst 6509-E Switch, Cisco Catalyst 6513 Switch, DHCP Snooping, Configuring DHCP Snooping, 802.1 Q, Trunk Ports So here we go, with the configuration of DHCP snooping on a Cisco Switch. This feature protects the network by allowing the Cisco Switches to accept DHCP response message only from the authorized servers connected to the trusted interfaces in a Cisco Switch.

All Switch to Switch connections are configured as 802.1 1Q Trunk ports. IP Address and HSRP Details for the Core Switches

From the above scenario we have two Cisco 6513 Series Switches as a Core/ Distribution with three VLANS one for management of Switches VLAN 50,VLAN 100 for all the servers and VLAN 101 for clients. Two Cisco 3560 Series Switches as Server Farm Switches and a Cisco 3560 Series Switch as an Access Switch.There are two DHCP servers with an IP address 10.0.1.100 and 10.0.1.101 connected with Server Farm Switches with HP NIC teaming. We configure DHCP Snooping based on above scenario. The first step to configure DHCP Snooping is to turn on DHCP snooping in all Cisco Switches using the ip dhcp snooping command.

All Cisco Switches (config)#ip dhcp snooping Second step is to configure the trusted interfaces, from the above scenario all trunk ports are configured as trusted ports as well as the interfaces G0/7, (ITKESF01 50.0.0.6), G0/17,(ITKESF02 50.0.0.7), G0/9 ITKESF01 50.0.0.6) and G0/18 ITKESF02 50.0.0.7) connected to DHCP servers with IP 10.0.1.100 and 10.0.1.101. Lets configure all trunk ports in ITKEBB01 ITKEBB01(config)#interface range gigabitEthernet 3/21 - 23 ITKEBB01 (config-if)#ip dhcp snooping trust Now lets configure all trunk ports in ITKEBB02 ITKEBB02(config)#interface range gigabitEthernet 3/21 - 23 ITKEBB02 (config-if)#ip dhcp snooping trust ITKEBB02 (config)#interface gigabitEthernet 3/16 ITKEBB02 (config-if)#ip dhcp snooping trust Now lets configure the trusted ports for the DHCP servers ITKESF01(config)#interface gigabitEthernet 0/7 ITKESF01 (config-if)#ip dhcp snooping trust ITKESF01(config)#interface gigabitEthernet 0/17 ITKESF01 (configif)#ip dhcp snooping trust ITKESF02(config)#interface gigabitEthernet 0/9 ITKESF02 (config-if)#ip dhcp snooping trust ITKESF02(config)#interface gigabitEthernet 0/18 ITKESF02 (configif)#ip dhcp snooping trust Now lets configure the trunk ports Access Switch ITKEAS01 ITKEAS01(config)#interface range gigabitEthernet 0/49 - 52 ITKEAS01 (config-if)#ip dhcp snooping trust Finally we are going to configure VLANS for DHCP snooping DHCP snooping will used on all the VLANs (VLAN 100 & 101)except management VLAN 50 . Also we will limit the requests rate received in the Access Switch (ITKEAS01) ALL SWITCHES(config)# ip dhcp snooping VLAN 100,101 ITKEAS01(config)#interface range gigabitEthernet 0/1 - 48

ITKEAS01 (config-if)#ip dhcp snooping limit rate 20 Displaying the DHCP snooping

For further reference please do check this article from Cisco about DHCP snooping.

Configure Your Catalyst for a More Secure Layer 2


January 20, 2005 By Charlie Schluting

Submit Feedback More by Author Post a comment Email Article Print Article Share Articles o Digg o del.icio.us o Newsvine o Facebook o Google o LinkedIn o MySpace o Redit o Slashdot o StumbleUpon o Technorati o Twitter o Windows Live o YahooBuzz o FriendFeed

The latest Cisco Catalyst switches, including the 6500, 4500, and 3750, have some wonderful new features to keep your network safer and more secure. These multilayer switches are capable of inspecting ARP and layer 3/4 packets, which allows for very effective security features. In this article we will describe and explain these new advances, referred to by Cisco as Catalyst Intelligent features. Using Smartports, the Catalyst switches can inspect, and keep track of DHCP (define) assignments. This means that if a client was assigned an IP address via DHCP, the switch can enforce that assignment by blocking any packets sent from the client's port claiming to be from a different IP addresses. This is accomplished by enabling DHCP snooping and IP source guard. Using the DHCP tables, the switch can also block forged ARP (define) packets, a feature called Dynamic ARP inspection.

DHCP Snooping Related Stories


Identify and Mitigate Windows DNS Threats FreeRADIUS and Linux Secure Your WLAN The (Practically) Ultimate OpenSSH/Keychain Howto More Related Stories

-->

DHCP snooping is a security feature that filters untrusted DHCP messages, and can protect clients on the network from peering up with an unauthorized DHCP server. When enabled, it builds a table of MAC address, IP address, lease time, binding type, and interface information (the switch's interface).

Using the features that leverage knowledge gained from DHCP snooping can create a new level of local network security. Combine that with port-level MAC security, and network admins will no longer cringe at the thought of turning on a network connection in a public area.

There is also an important difference between trusted and untrusted interfaces when talking about DHCP snooping. Switch ports connected to the end-user should be configured as untrusted. Trusted interfaces are those connected to your DHCP server or another switch. When DHCP snooping on the entire switch is enabled, the switch acts like a firewall for your VLAN (define) . You'll also want to enable DHCP snooping on the VLAN, to allow the switch to act as a firewall for the entire VLAN domain. Here's how it's done:
!Turn on snooping for the entire switch: Switch(config)# ip dhcp snooping Switch(config)# ip dhcp snooping vlan [number or range] !Our DCHP server: Switch(config)# interface GigabitEthernet 5/1 Switch(config-if)# ip dhcp snooping trust !An untrusted client (not a required step): Switch(config-if)# interface FastEthernet 2/1 Switch(config-if)# ip dhcp snooping limit rate 10

A few notes on this: First, and most importantly, you must realize that this will cause all DHCP requests to be dropped until a port is configured as trusted.

Hence, this should be turned on with great care. Second, this isn't as cumbersome as it may seem. You can use the Interface Range command to specify all trusted ports at once. Here's how to enable trust on all trunk ports and ports that a dhcp server is connected to:
Switch(config)#interface range FastEthernet 2/0/1 8 , GigabitEthernet 1/0/1 - 3 Switch(config-if-range)# ip dhcp snooping trust

Interface range is a little-known command, introduced in IOS 12.1 that saves a tremendous amount of time. The last caveat with DHCP snooping is that you must establish a trust relationship with downstream DHCP snoopers on a trunk port:
Switch(config-if)# ip dhcp relay information trusted

Now, you may be thinking "DHCP snooping sounds nice, but what happens when I reboot the switch and the snooper doesn't have a database of leases anymore? Won't it require clients to re-obtain their DHCP leases?" Yes. Cisco thought of this, and created a mechanism by which the database can be saved. It is possible to configure the database to live on flash memory, but because of space limitations it's best to use a tftp server with the command:
Switch(config)# ip dhcp snooping database tftp://10.1.1.1/file

The database is updated constantly, and should survive a quick reboot. If some DHCP leases have expired by the time the switch comes alive again, those entries will be invalid, and the client won't have connectivity until it tries to peer up with DHCP again.

IP Source Guard and Port Security


Using just DHCP snooping, you have stopped untrusted devices from acting as a DHCP server; which is important in an environment where people think it's a good idea to bring in their Linksys access point to better cover the office with wireless. Port Security can also help to stop more than one MAC from being seen on a port, making it impossible to connect hubs and other network-extending devices. Now, to stop malicious people from using IP addresses that weren't assigned to them, we use IP source guard. Even better, we can also stop clients from forging their MAC address. MAC address filtering makes flooding the switch impossible. Flooding is a technique by which an attacker sends so many MAC addresses from their port that the switch's MAC table overflows. Then the switch has no choice but to flood all Ethernet frames out of every single port, since it doesn't know what

MAC is connected where, allowing an attacker to see all the traffic across the switch. Some viruses have been known to do this as well.
Switch(config-if)# ip verify source vlan dhcp-snooping

But be careful! If the DHCP table doesn't have an association for this port, you've just stopped all IP traffic from it. It is recommended that DHCP snooping be turned on a day before enabling IP source guard to allow it to gather information. To apply MAC address security, you must turn it on, then configure appropriate options:
!Set explicit access mode (dynamic or trunk ports can't have security) Switch(config-if)# switchport mode access !Enable port-security Switch(config-if)# switchport port-security !Specify how many MAC addresses can be used: Switch(config-if)# switchport port-security maximum 1 !Action to take when a violation happens: Switch(config-if)# switchport port-security violation {restrict | shutdown}

Violation Restrict will not disable the switch port, but instead cause the switch to increment a security violation counter, and send an SNMP trap. These options are quite configurable, you can even specify how long to shut down the port when a violation occurs. An alternative, less dynamic method, is to program the MAC address binding as static. This stops any other MAC from working on a port, ever.

Dynamic ARP Inspection


ARP inspection allows the switch to discard ARP packets with invalid IP to MAC address bindings, effectively stopping common man-in-themiddle attacks. ARP poisoning is a tactic where an attacker injects false ARP packets into the subnet, normally by broadcasting ARP responses where the attacker claims to be someone else. To curtail poisoning, Dynamic ARP Inspection (DAI) uses our friend, the DHCP snooping table. There are many options, and you must be careful enabling DAI if all network devices don't support it. The most basic configuration is:
Switch(config)# ip arp inspection vlan 1

Trunk ports need to be trusted:


Switch(config)# int range f1/1 - 4 , f2/24 Switch(config-if)# ip arp inspection trust

You can view the status with:


Switch# show ip arp inspection ?

Using the features that leverage knowledge gained from DHCP snooping can create a new level of local network security. Combine that with portlevel MAC security, and network admins will no longer cringe at the thought of turning on a network connection in a public area. Testing these features in a production environment is, of course, not recommended: Many of them have wicked side effects if configured incorrectly or out of order.
Read more on "Secure Your Infrastructure"

March 3, 2010
My definition of DHCP-snooping
Filed under: Information Technology,Security Tags: cisco, config, dhcp, snooping, trusted, untrusted Tim Lefler @ 2:04 pm

Ciscos Overview of DHCP Snooping DHCP snooping is a DHCP security feature that provides security by filtering untrusted DHCP messages and by building and maintaining a DHCP snooping binding table. An untrusted message is a message that is received from outside the network or firewall and that can cause traffic attacks within your network. The DHCP snooping binding table contains the MAC address, IP address, lease time, binding type, VLAN number, and interface information that corresponds to the local untrusted interfaces of a switch; it does not contain information regarding hosts interconnected with a trusted interface. An untrusted interface is an interface that is configured to receive messages from outside the network or firewall. A trusted interface is an interface that is configured to receive only messages from within the network. DHCP snooping acts like a firewall between untrusted hosts and DHCP servers. It also gives you a way to differentiate between untrusted interfaces connected to the end-user and trusted interfaces connected to the DHCP server or another switch. Well thanks for that extremely clear overview.. what actually is going on? Lets say you have a switch. You hook a DHCP server up to port #1 and designate this as a trusted interface and all of the rest of the ports that will have devices connected to them are setup as untrusted. You would set this up using the commands:
*** Enable DHCP Snooping & ARP Inspection *** ip dhcp snooping vlan 100 no ip dhcp snooping information option ip dhcp snooping database flash:/dhcpdb.dat ip dhcp snooping ip arp inspection vlan 100 *** Untrusted Access Interfaces for DHCP **** Int Range Fa1/0/2 - 48 description Workstation switchport access vlan 100 switchport mode access no mdix auto Int Range Fa2/0/1 - 48 description Workstation switchport access vlan 100 switchport mode access no mdix auto *** Trusted Access Interface for DHCP *** Int Fa1/0/1 description DHCP Server switchport access vlan 100

switchport mode access no mdix auto ip dhcp snooping trust

DHCP Client requests are forwarded regardless of the trust state of the port, but DHCP server responses are dropped if the port is untrusted. So lets say on port #2 the switch sees a DHCP discovery packet float by from a DHCP client. Because it is a broadcast message this gets flooded to all ports on the VLAN. The DHCP server connected to port #1 sees the discovery packet and sends an uninicast DHCPOFFER packet to the client. Because this originated from a trusted port the offer is allowed to go through. The client recieves the DHCPOFFER chooses an offer from all that it receives and responds with a DHCPREQUEST back to the DHCP server. The server then responds with a DHCPACK and includes the configuration parameters and committed network address. The switch records the client binding port, vlan, mac address, and ip, etc into its local snooping database. So in a nutshell DHCP snooping offers some additional security to ensure only your DHCP servers are responding to DHCP client broadcasts and it also is a convenient way to keep track of what client IPs are connected to what port. So now a real world example..lets say my IPS detects malicious traffic from an IP address: 10.1.144.81 Below is the CLI for the switch to find a IP address We can get the MAC, IP address, amount left on the lease, vlan #, interface on the switch from the dhcp-snooping database:
switchXYZ#sh ip dhcp snooping binding | include 10.1.144.81 00:1E:EC:1E:74:DA 10.1.144.81 15468045 dhcp-snooping FastEthernet2/0/32 100

Below is a example displaying part of the dhcp snooping database.


switchXYZ#sh ip dhcp snooping binding MacAddress IpAddress Lease(sec) Interface ------------------ --------------- ----------------------------00:16:D4:A5:89:22 10.1.144.64 14956850 FastEthernet1/0/42 00:1C:25:98:50:43 10.1.144.87 12637737 FastEthernet1/0/41 00:1E:EC:1E:74:C4 10.1.144.119 14519969 FastEthernet2/0/36 00:21:97:C4:27:17 10.1.144.85 15551889 FastEthernet2/0/28 00:1B:38:F1:F4:F8 10.1.144.95 6503907 FastEthernet1/0/35 00:1E:EC:1E:74:DA 10.1.144.81 15468308 FastEthernet2/0/32 00:1C:23:88:E9:01 10.1.144.71 11418033 FastEthernet2/0/4 00:1B:38:7B:6C:7E 10.1.144.66 12013698 FastEthernet1/0/1 Type ------------dhcp-snooping dhcp-snooping dhcp-snooping dhcp-snooping dhcp-snooping dhcp-snooping dhcp-snooping dhcp-snooping VLAN ---100 100 100 100 100 100 100 100

00:1F:6C:81:2F:8B FastEthernet2/0/38 00:22:55:5E:62:CB FastEthernet1/0/36 00:1E:13:8C:D8:82 FastEthernet3/0/39

10.1.145.60 10.1.145.56 10.1.145.132

15542941 15542874 15542955

dhcp-snooping dhcp-snooping dhcp-snooping

100 100 100

Total number of bindings: 204

Once we know what port the IP address is associated with we can quickly lookup information on the port.. and if you use meaningful descriptions you could get the workstation location.
switchXYZ#sh run Typein: /2/0/32 <------ The first slash gives you a find feature, the next number and slashes are the port info Int Fa2/0/32 description Workstation Cube XYZ switchport access vlan 100 switchport mode access no mdix auto

References: DHCP RFC Cisco Understanding and Configuring DHCP Snooping


Comments (1)

3. DHCP snooping. Los servidores DHCP no legtimos se dedican a contestar peticiones DHCP de los clientes. Estos servidores proporcionan informacin que indica que ellos mismos son la puerta de enlace o el DNS. De esta forma consiguen realizar un man-in-the-middle. Otros de los ataques consiste en agotar (DoS) el pool de direcciones que un servidor DHCP puede proporcionar a los clientes. El DHCP snooping permite especificar qu puertos pueden contestar a solicitudes DHCP. Los puertos que pueden contestar y enviar solicitudes DHCP son los puertos seguros. Los puertos inseguros slo pueden enviar solicitudes DHCP. Por lo tanto, configuraremos como seguros los puertos que contengan servidores legtimos y como inseguros los puertos de usuario. En el momento en el que un puerto inseguro recibe una respuesta (DHCPOFFER, DHCPACK, DHCPNAK) a una solicitud DHCP este puerto se deshabilita automticamente (shutdown). Switch(config)#ip dhcp snooping Switch(config)#interface FastEthernet 0/1 Switch(config-if)#ip dhcp snooping trust Switch(config)#interface range FastEthernet 0/2 - 23 Switch(config-if)#ip dhcp snooping limit rate 2 cita: http://hacktracking.blogspot.com/2008/10/32-mitigando-los-ataquesde-la-capa-2.html lo otro puede ser esto: http://www.lesand.cl/foro/index.php?topic=924.0

Introduccin

El objetivo de este articulo es el de explicar los elementos bsicos de la configuracin y administracin de routers Cisco. Para la lectura de este artculo es necesario conocer la funcin de un router y los protocolos de enrutamiento. Si aun no los conoces, puedes leer el articulo acerca de los routers. Para la explicacin de este articulo, el esquema con los dos PC representar a dos redes diferentes conectadas por un router (el programa PacketTracer ha sido utilizado para los test durante la redaccin de este articulo).

ndice

Etapa 1: Implementacin o Equipo necesario o Esquema de pirmide o Configuracin IP de los PC Etapa 2: Cableado de la red, uso del cable de consola Etapa 3: Configuracin del router con los comandos IOS o IOS o Los diferentes modos de usuarios o Poner una contrasea al acceso Privilegiado o Configuracin de las interfaces Ethernet del router o Configuracin del acceso Telnet al router Resumen de los comandos IOS bsicos o Paso entre los diferentes modos de usuarios o Comandos de informacin o Comandos de interfaz o Comandos para hacer una copia de seguridad de la configuracin actual o Comando de anulacin o Anulacin de un comando en particular o Cambiar el nombre del router o Poner una contrasea al usuario privilegiado Conclusin

Etapa 1: Implementacin
Equipo necesario

Un router Cisco Dos PC (representado las redes) El cable de consola proporcionado con el router

Esquema de pirmide

Configuracin IP de los PC
PC 1:

Direccin IP/Mascara: 192.168.1.254/24 Puerta de enlace: Ser la direccin IP de la interfaz del router a la cual est conectada el PC

PC 2:

Direccin IP/Mascara: 10.0.0.254/8 Puerta de enlace: Ser la direccin IP de la interfaz del router a la cual est conectada el PC

Etapa 2: Cableado de la red, uso del cable de consola


Las dos redes ya estn conectadas al router. Sin embargo, no hay comunicacin entre ellas. Comenzaremos por conectar el cable de consola

(cable azul) entre el router y el PC que se va a utilizar para la configuracin. Inicialmente, utilizaremos HyperTerminal (de Microsoft) para efectuar las operaciones necesarias.

Etapa 3: Configuracin del router con los comandos IOS


IOS
IOS es el acrnimo de Internetworks Operating System", en espaol Sistema operativo para la interconexin de redes. Este sistema puede ser administrado en lnea de comandos, propios a los equipos de Cisco Systems.

Los diferentes modos de usuarios

Modo usuario: Permite consultar toda la informacin relacionada al router sin poder modificarla. El shell es el siguiente:

Router >

Usuario privilegiado: Permite visualizar el estado del router e importar o exportar imgenes de IOS. El shell es el siguiente:

Router #

Modo de configuracin global: Permite utilizar los comandos de configuracin generales del router. El shell es el siguiente:

Router (config) #

Modo de configuracin de interfaces: Permite utilizar comandos de configuracin de interfaces (Direcciones IP, mascaras, etc.). El shell es el siguiente:

Router (config-if) #

Modo de configuracin de lnea: Permite configurar una lnea (ejemplo: acceso al router por Telnet). El shell es el siguiente:

Router (config-line) #

Modo espacial: RXBoot Modo de mantenimiento que puede servir, especialmente, para reinicializar las contraseas del router. El shell es el siguiente:

rommon >

Poner una contrasea al acceso Privilegiado


Esta parte explica como poner una contrasea al usuario privilegiado. Lo primero que hay que hacer es conectarse en modo privilegiado, luego en modo de configuracin global para efectuar esta manipulacin:
Router > enable Router # configure terminal Router (config) #

Una vez en modo de configuracin global, tan solo hay que ingresar un comando para poner una contrasea:
Router (config) # enable password contrasea

La prxima vez que un usuario intente conectarse en modo usuario privilegiado, le ser solicitada una contrasea. Hasta aqu, se recomienda guardar regularmente la configuracin utilizando el siguiente comando (en modo privilegiado):
copy running-config startup-config

Configuracin de las interfaces Ethernet del router


Ahora, debemos hacer que se comuniquen las dos redes conectadas al router. Supongamos que el nombre de la interfaz conectada a PC1 es fa0/0 y el de la conectada a PC2 es fa0/1 y que estamos en modo de configuracin global. A continuacin los comandos a ingresar:

Interfaz fa0/0:

Router (config) # interface fa0/0 Router (config-if) # ip address 192.168.1.1 255.255.255.0 Router (config-if) # no shutdown Router (config-if) # exit

Interfaz fa0/1:

Router (config) # interface fa0/1 Router (config-if) # ip address 10.0.0.1 255.0.0.0 Router (config-if) no shutdown Router (config-if) exit

Esto es todo en relacin a la configuracin de las interfaces. Las dos redes deberan ahora comunicarse entre ellas. Podemos comprobarlo con un comando ping de un PC de una red hacia un PC de otra red. No olvides guardar tu configuracin actual utilizando el comando apropiado.

Configuracin del acceso Telnet al router


Ya que la configuracin con el cable de consola y HyperTerminal no es prctico, se puede permitir que los administradores se conecten al router va una sesin Telnet desde cualquier PC de una de las dos redes. Pasamos primero en modo de configuracin global, luego en modo de configuracin de lnea VTY:
Router > enable Password?: Router # configure terminal Router (config) # line vty 0 4

configurar la posibilidad de 5 sesiones telnet simultneas en este router. Llegamos ahora al prompt de configuracin de lnea. Para activar Telnet, no hay ms que poner una contrasea a la lnea:

Router (config-line) # password contrasea Router (config-line) # exit

Guardamos la configuracin. Hemos terminado con la configuracin bsica del router. Ahora vamos a hacer un resumen de los diferentes comandos utilizados y que pueden ser utilizados en el caso precedente. Importante: antes de conectarnos va una sesin Telnet debemos haber definido una contrasea para el modo privilegiado. Si no es as, el router rechazar la conexin.

Resumen de los comandos IOS bsicos


NOTA: Si varios comandos aparecen uno despus de otro para una misma funcin, esto significa que todos tienen la misma funcin y que cualquiera de ellos puede ser utilizado indistintamente.

Paso entre los diferentes modos de usuarios


Usuario normal: Ningn comando a ejecutar, es en este modo que comienza una sesin. Usuario privilegiado (a ejecutar desde el modo normal):

Router > enable Router > en

Modo de configuracin global (a ejecutar desde el modo Privilegiado):

Router # configure Terminal Router # conf t

Modo de configuracin de interfaz (a ejecutar desde el modo de configuracin global):

Router (config) # interface nombre_interfaz Router (config) # int nombre_interfaz

Modo de configuracin de lnea (a ejecutar desde el modo de configuracin global):

Router (config) # line nombre_de_la_linea

Comandos de informacin
Los comandos de informacin permiten mostrar la informacin relativa al router. Todos comienzan con el prefijo show o sh. La mayora deben ser ejecutados desde el modo privilegiado.

Mostrar el archivo de configuracin actual del router:

show running-config show run sh run

Mostrar informacin sobre la configuracin de hardware del sistema y sobre el IOS:

show version sh version

Mostrar los procesos activos:

show processes

Mostrar los protocolos configurados de la capa 3 del modelo OSI:

show protocols

Mostrar las estadsticas de memoria del router:

show memory

Mostrar informacin y estadsticas sobre una interfaz:

show interfaces nombre_interfaz sh interfaces nombre_interfaz sh int nombre_interfaz *Mostrar la tabla de enrutamiento IP: <code>sh ip ruta

Comandos de interfaz
Estos comandos estn ligados a la configuracin de la interfaz del router. La mayora deben ser ejecutados desde el modo de configuracin de interfaz.

Asignacin de una direccin IP a una interfaz:

ip address @IP mascara

Activacin de la interfaz:

no shutdown

Comandos para hacer una copia de seguridad de la configuracin actual


Estos comandos permiten hacer una copia de seguridad de la configuracin actual para restaurarla automticamente en caso de reinicio del router. Estos se ejecutan en modo Privilegiado.

Copia de seguridad con solicitud de confirmacin:

copy running-config startup-config copy run start

Copia de seguridad sin solicitud de confirmacin:

write

Comando de anulacin
Este comando permite regresar a la ltima configuracin guardada, anulando todas las modificaciones que han sido hechas despus a la configuracin. Se ejecuta en modo Privilegiado.
copy startup-config running-config copy start run

Anulacin de un comando en particular


Para anular un comando en particular, utilizaremos el prefijo no delante del comando que se ejecuto anteriormente. Ejemplo: anular la configuracin de una interfaz:
no ip address

Cambiar el nombre del router


El nombre del router puede ser modificado a fin de poder diferenciarlo en la red o redes. El comando ser ejecutado en modo de configuracin global.
host NuevoNombre

Un nombre diferente aparecer en el prompt en sesiones HyperTerminal o Telnet.

Antes:

Router >

Despus:

NuevoNombre >

Poner una contrasea al usuario privilegiado


Estos comandos deben ser ejecutados en modo de configuracin global:

Asignacin normal:

enable password contrasea

Asignacin encriptada:

enable secret contrasea

El siguiente es un pequeo resumen sobre comandos para configurar un switch cisco y algunos de router, espero que les sea til como lo es para mi. Rip NewYork(config)#interface fastethernet0/0 NewYork(config-if)#ip address 192.168.50.129 255.255.255.192 NewYork(config-if)#ip rip send version 1 NewYork(config-if)#ip rip receive version 1 NewYork(config)#interface fastethernet0/1 NewYork(config-if)#ip address 172.25.150.193 255.255.255.240 NewYork(config-if)#ip rip send version 1 2 Show ip protocols show interface interface show ip interface interface show running-config Show ip rip database OSPF Router(config)#router ospf process-id Router(config-router)#network address wildcard-mask area area-id Router(config)#interface lookback 0 Router(config-if)#ip address 192.168.3.33 255.255.255.255 Rtr(config-if)# bandwidth 64

Rtr(config-if)# ip ospf cost 1562 Autenticacin sin md5 Router(config-if)#ip ospf authentication-key password Router(config-router)#area area-number authentication Autenticacin con md5 Router(config-if)#ip ospf message-digest-key key-id encryption-type md5 key Router(config-router)#area area-id authentication message-digest Router(config-if)#ip ospf hello-interval seconds Router(config-if)#ip ospf dead-interval seconds debug ip ospf events --aumentar la prioridad para elegir un router DR sw(config)#interface fasethernet 0/0 sw(config-if)#ip osfp priority 50 sw(config-if)#end EIGRP Router(config)#router eigrp as-id Router(config-router)#network 192.168.3.0 Router(config-router)#end Router# show ip eigrp topology eigrp log-neighbor-changes resumen de rutas: router(config-router)#no auto-summary Switch Switch# dir flash: Switch#show flash Switch#show vlan Switch#vlan database Switch(vlan)#vlan vlan_number Switch(vlan)#exit Switch(config)#interface fastethernet 0/9 Switch(config-if)#switchport access vlan vlan_number Switch#vlan database Switch(vlan)#no vlan 300 Switch(config)#interface fastethernet 0/9 Switch(config-if)#switchport access vlan vlan_number Sw1#delete flash:vlan.dat Sw1#erase startup-config Sw1#reload Interface web Sw1(config)#ip http port 80

Ver la tabla MAC: Switch#show mac-address-table (? Mas opciones) Switch#clear mac-address-table Asignar una mac estatica Switch(config)#mac-address-table static interface FastEthernet vlan Switch(config)#no mac-address-table static interface FastEthernet vlan Seguridad de Puerto Sw1(config)#interface fastETehernet 0/2 Sw1(config-if)#switchport port-security ?(sale las opciones) Limitar la cantidad de host por puerto 1900: Sw1(config)#interface fastETehernet 0/2 Sw1(config-if)#port secure mas-mac-count 1 2950: Sw1(config)#interface fastETehernet 0/2 Sw1(config-if)#switchport port-security maximum 1 Configuracion del Puerto que se desconecte cuando se produce una violacion de seguridad Sw(config-if)#switchport port-security violation shutdown 2900xl: Sw(config-if)#port security action shutdown

Poner Ip a la Vlan1 Catalyst 2950 Sw(config)#interface Vlan1 Sw(config-if)#ip address 192.168.1.2 255.255.255.0 Sw(config-if)#no shutdown Sw(config)# ip default-gateway 192.168.1.1 Catalyst 1900 Sw(config)#ip address 192.168.1.2 255.255.255.0 Sw(config)# ip default-gateway 192.168.1.1

Archivos de configuracion Sw# copy running-config startup-config 1900: Sw#copy nvram tftp://tftp server ip add/destination_filename COnfiguracion de la velocidad Switch(config)#interface fastethernet 0/9 Switch(config-if)#duplex full Switch(config-if)#speed 100 Crear el trunk del switch Sw(config)#interface fastethernet 0/1 Sw(config-if)#swicthport mode trunk Sw(config-if)#end 2900: Sw(config)#interface fastethernet 0/1 Sw(config-if)#swicthport mode trunk Sw(config-if)#swicthport trunk encapsulation dot1q Sw(config-if)#end 1900: Sw(config)#interface fastethernet 0/1 Sw(config-if)#swicthport mode trunk Sw(config-if)#swicthport trunk encapsulation dot1q Sw(config-if)#end Trunk en el router Router(config)#interface fastethernet 0/0 Router(config-if)#no shutdown Router(config-if)#interface fastEthernet 0/0.1 Router(config-subif)#encapsulation dot1q vlan-number Router(config-subif)#ip address. router1#copy running-config tftp Quitar un Puerto de una VLAN Switch(config)#interface fasethernet 0/9 Switch(config-if)#no switchport access vlan 300 Eliminar una vlan

Switch#vlan database Switch(vlan)#no vlan 300 Spanning tree show spanning-tree Configuracion de VTP switch#vlan database switch#vtp v2-mode switch(vlan)#vtp domain password switch#vtp {client | server | transparent} Copiar el IOS a un server tftp Sw#copy flash tftp 2900: sw#copy flash:nombre_del_archivo tftp Copiar IOS desde un Server tftp Sw#copy TFTP flash Sw# copy Start tftp 1900: sw#copy nvram tftp://numero-ip/name Sw#copy tftp startup-config 1900: sw#copy tftp://numero-ip/name nvram Recuperar el acceso al switch 1. Apagar el switch, Vuelva a encenderlo mientras presiona el boton MODE en la parte delantera del switch. Deje de presionar el boton MODE una vez que se apague el led de STAT 2. introducir los siguientes comandos: flash_init load_helper dir flash: 3. rename flash:config.text flash:config.old 4. reiniciar el sistema original: 4.1 despues de entrar al switch hacer: rename flash:config.old flash:config.text 4.2 sw#copy flash:config.text system:running-config 4.3 Cambiar los password

Actualizar el firmware Sw#show boot (muestra el archive de boteo) Cambiar el nombre del archivo de la ios,con el commando #rename flash:nombre flash:Nuevo_nombre Sw(config)#no ip http Server Sw# delete flash:html/* Extraer la nueva version del IOS Sw#archive tar /x tftp://192.168.1.3/nombre_del_archivo.tar flash: Sw(config)#ip http Server Sw(config)#boot system flash:nombre.bin Spanning-Tree #show spanning-tree brief Cambiar prioridad: ios 12.0 sw(config)#spanning-tree priority 1 sw(config)#exit ios 12.1 sw(config)#spanning-tree vlan 1 priority 4096 sw(config)#exit Configurar VLAN Sw#vlan database Sw(vlan)#vlan 2 name Logistica Sw(vlan)#vlan 3 name Licitaciones Sw(vlan)#end 1900: Sw#config terminal Sw(config)#vlan 2 name VLAN2 Sw(config)#vlan 3 name VLAN3 Configurar puertos en las VLAN Sw#conf term Sw(config)#interface fastethernet 0/2 Sw(config-if)#switchport mode access Sw(config-if)#switchport access vlan2 Sw(config-if)#end Elminar el Puerto de la vlan Sw(config-if)#no switchport access vlan2 Sw(config-if)#end

1900: Sw#conf term Sw(config)#interface fastethernet 0/2 Sw(config-if)#vlan static 2 Para eliminar un Puerto de la vlan Sw(config-if)#no vlan-membership 2 Sw#show vlan Sw#show vlan id 2 1900: Show vlan-membership Show vlan 2 Eliminar un vlan Sw#valn database Sw(vlan)#no vlan 3 Sw(vlan)# exit 1900: sw(confgi)# interface ethernet 0/7 sw(confgi)#no vlan 3 enlacen troncal ISL sw(Config.)#interafce fastethernet 0/1 sw(Config-if)#switchport mode trunk sw(Config-if)#switchport trunk encapsulation isl sw(Config-if)#end enlace troncal 802.1q 2950: por defecto dotiq sw(Config.)#interafce fastethernet 0/1 sw(Config-if)#switchport mode trunk 2900: sw(Config.)#interafce fastethernet 0/1 sw(Config-if)#switchport mode trunk sw(Config-if)#switchport trunk encapsulation dot1q Vtp , servidor y cliente Sw# Vlan database Sw(vlan)# vtp server Sw(vlan)# vtp domain group1 Sw(vlan)# exit Sw# Vlan database

Sw(vlan)# vtp client Sw(vlan)# vtp domain group1 Sw(vlan)# exit Ruteo entre VLAN Poner el encapsulamiento en las subinterfaces del router (config-if)#interface fastethernet 0/0.1 (config-subif)#encapsulation dot1q 1 (1 es la vlan a la que esta) tambien les dejo un manual de configuracion. http://asignaturas.diatel.upm.es/rrss1/documentacion_archivos/LABORATORIO %20ACTUAL/manual_rapido_cisco.pdf

Siempre es util tener una lista de los comando de un router, hice este resumen de algunos comando s. Si hay gente que sepaalgunos puede agregarlos para ayuda de todos. Router> Router>enable Router# Router# configure terminal Router(config)# Historia de commandos #show history Reloj Router#clock set 19:50:00 14 july 2003 Cambiar nombre del router Router(config)#hostname Expo Expo(config)# Configurar una Interfaz DCE Expo(config)#interface serial 0/0 Expo(config-if)# ip address IP MASK Expo(config-if)#bandwidth 56 Expo(config-if)#clock rate 64000 Expo(config-if)#no shutdown Expo(config-if)#end DTE Expo(config)#interface serial 0/0 Expo(config-if)# ip address IP MASK Expo(config-if)#bandwidth 56 Expo(config-if)#no shutdown Expo(config-if)#end

Expo(config)#interface fastethernet 0/0 Expo(config-if)#ip address IP MASK Expo(config-if)#no shutdown Expo(config)#end Copy Router# copy flash tftp

Router#copy running-config tftp Router#copy tftp running-config Configuracin de Rutas Estticas Expo(config)#ip route RED MASK GATEWAY Poner Password al Router Expo(config)#line console 0 Expo(config-line)#password ******* Expo(config-line)#login Expo(config)#line vty 0 4 Expo(config-line)#password ******* Expo(config-line)#login Expo(config)#enable password ****** Encriptar Password Expo(config)#service password-encription Expo(config)#enable secret ******* Hostname Expo(config)#ip host NOMBRE IP Uso de protocolo cdp Expo(config)#cdp run Expo(config)#no cdp run Expo#show cdp neighbors Expo#show cdp neighbors detail Booteo del router Expo(config)#boot system flash IOS_filename Expo(config)#boot system tftp IOS_filename tftp_addres Expo(config)#boot system rom Copiar el IOS desde un Tftp desde la ROMmon Rommon1>set (llevar los valores pedidos del servidor tftp) Rommon2>tftpdnlp Archivos de configuracin Expo(config)#config-register 0x2142 (para no cargar archivos de configuracin de la nvram) Expo(config)#config-register 0x2102 (para cargar archivos de configuracin de la nvram) 0xnnn0 = usar el modo de monitoreo rom 0xnnn1= carga la primera imagen de la flash

De 0xnnn2 a 0xnnnf = carga el archivo de la nvram Configuracin de las Rutas por defecto Expo(config)#ip route 0.0.0.0 0.0.0.0 [direccin del siguiente salto] [interface de salidad] Enrutamiento RIP Expo(config)#router rip Expo(config-router)#network direccion de la RED(red conectada al router) Debug ip rip

Enurutamiento IGRP Expo(config)#router igrp 101(sistema autnomo) Expo(config)#network direccion de la RED(red conectada al router)

Recuperar un router con password Arrancar el router con el hyperterminal conectado. Antes de que pase 60 segundos mandar una secuencia BREAK al puerto serie, desde el hyperterminal se corresponde con las teclas Crtl+Pausa. Se entrara en modo ROMMON. El promtp ser: rommon 1> Teclear el comando confreg 0x2142 El promt ser ahora rommon 2> Teclear reset. El router se reinicia. Despus de arrancar saltarse las preguntas que hace el router para la configuracin inicial con Ctrl+C . Teclear enable, (ahora no hay passwords). Y desde el promt en # teclear: write erase reload para reiniciar de nuevo. Activar interfaz WEB ip http Server Recuperacin Del Rommon se puede entrar ctrl.-break rommon rommon1> IP_ADDRESS = direccin de la interfaz LAN rommon2>IP_SUBNET_MASK= Mascara de subred para la interfaz LAN rommon3>DEFAULT_GATEWAY= gateway predeterminado para la interfaz LAN

rommon4>TFTP_SERVER= direccion ip del server tftp rommon5>TFTP_FILE= Nombre de archivo del software cisco rommon6> set IP_ADDRESS = direccin de la interfaz LAN NET_MASK= Mascara de subred para la interfaz LAN DEFAULT_GATEWAY= gateway predeterminado para la interfaz LAN TFTP_SERVER= direccion ip del server tftp TFTP_FILE= Nombre de archivo del software cisco Rommon7>tftpdnld Rommon8>dir flash: (para verificar el archivo) Rommon9>reset Copiar el IOS desde un server tftp router# copy tftp flash pregunta sobre la ip? Ip address del Server tftp nombre del archivo ios? Nombre del archivo Mensaje del dia MOTD Configure Terminal banner motd # Escriba aqu el mensaje del da #. copy running-config startup-config Access list Estndar Router#Access-list #(access-list) ip wildmask interface Router(config-if)#ip access-group 1 in Router(config-if)#ip access-group 1 out Access-list extendida access-list [100-199] [permit/deny][protocolo] [ip origen] [ip destino] [tipo de servicio] ip access-group [100-199] [in/out] ejm. Denegar un host access-list 1 deny 192.168.500.5 0.0.0.0 access-list 1 permit 0.0.0.0 255.255.255.255 interface>>>>>>>ip access-group 1 out

Access-list nombrada Router(config)#Ip access-list [standard/extended] [nombre] Router(config-std-nacl)#[permit/deny] [ip origen] Router(config-ext-nacl)#[permit/deny] [protocolo][ip origen] [ip destino] [tipo de servicio] Ejm. Denegar el telnet a una subred Access-list 101 deny tcp 172.16.4.0 0.0.0.255 any eq 23 Access-list 101 permit ip any any Interface>> access-group 101 out

Acces-list en terminales virtuales Router(config)#Ip access-list 10 permit 192.168.100.15 Router(config)#line vty 0 4 Router(config-line)#access-class 10 in

Visualizadores Show access-list (#) Muetsra todas la access list o una em particular Show ip access-list Muetsra la acl ip Show ip interface muestra los puertos que tienen activada acl Show running-config muestra las listas de acceso y donde estan aplicadas

Puertos ftp 21 tcp telnet 23 tcp smtp 25 tcp dns 53 udp dhcp 67 udp tftp 69 udp http 80 tcp pop3 110 irc 164 snmp 161

vizualisadores show flash show version Show interfaces Show controllers serial (muestra la informacin sobre la sincrona)

Show Show Show Show Show Show Show Show Show Show Show

clock hosts users history flash version startup-configuration running-configuration cdp neighbors cdp interface ip protocols

Administracion Router#Traceroute [ip de destino] Descripcion de una interface Router(config)#interface xxxxx Router(config-if)#description xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Host Router(config)# ip host [nombre] [direccion ip] Telnet router>telnet denx denx>exit denx>ctrl shift 6 x router> Horizontre divido ip split-horizon no ip split-horizon

Poison Reverse(envenenamiento de rutas) IGRP router(config)# router igrp 109 router(config-router)# default-metric 1000 100 250 100 1500 (bandwidth = 1000 (1Mbps), delay = 100 (1 sec), reliability = 250 (near 100% reliable), loading = 100 (100% bandwidth), and MTU = 1500 (bytes). ) RIP (poison reverse tiene precedencia sobre split horizon, si tambin est habilitado split horizon) El comando es set rip poisonreverse enable

CAMBIO ENTRE MODOS router> router> enable (pasa al Modo Exec Privilegiado) router# router# exit (vuelve a al Modo Exec Usuario) router> enable router# router# config terminal (pasa al Modo Configuracin Global) router(config)# router(config)# exit CTRL+z (vuelve al Modo Exec Privilegiado) router# NOMBRAR AL ROUTER router> enable router# configure terminal router(config)# hostname RouterA (nombra al router como) RouterA(config)# CONFIGURAR CONTRASEAS ENABLE SECRET Y ENABLE PASSWORD RouterA> enable RouterA# configure terminal RouterA(config)# enable secret contrasea (configura contrasea Enable Secret) RouterA(config)# enable password contrasea * (configura contrasea Enable Password) RouterA(config)# * Es recomendable configurar Enable Password ya que genera una clave global cifrada en el router. CONFIGURAR CONTRASEA DE CONSOLA RouterA> enable RouterA# config terminal RouterA(config)# line con 0 (ingresa a la Consola) RouterA(config-line)# password contrasea (configura contrasea) RouterA(config-line)# login (habilita la contrasea) RouterA(config-line)# exit RouterA(config)# CONFIGURAR CONTRASEA VTY (TELNET) RouterA> enable RouterA# config terminal

RouterA(config)# line vty 0 4 (crea las 5 lneas VTY, pero podra ser una sola. Ej: line vty 0) RouterA(config-line)# password contrasea (contrasea para las 5 lneas en este caso) RouterA(config-line)# login (habilita la contrasea) RouterA(config-line)# exit RouterA(config)# CONFIGURAR INTERFACES ETHERNET FAST ETHERNET RouterA> enable RouterA# config terminal RouterA(config)# interface fastethernet 0/0 * (ingresa al Submodo de Configuracin de Interfaz) RouterA(config-if)# ip address 192.168.0.1 255.255.255.0 (configura la IP en la interfaz) RouterA(config-if)# no shutdown (levanta la interfaz) RouterA(config-if)# description lan (asigna un nombre a la interfaz) RouterA(config-if)# exit RouterA(config)# * Tener en cuenta que la interfaz puede ser Ethernet o Fast Ethernet y que el nmero de interfaz puede ser 0, 1, 0/0, 0/1, etc. Esto vara segn el router. CONFIGURAR INTERFACES SERIAL COMO DTE RouterA> enable RouterA# config terminal RouterA(config)# interface serial 0/0 * (ingresa al Submodo de Configuracin de Interfaz) RouterA(config-if)# ip address 10.0.0.1 255.0.0.0 (configura la IP en la interfaz) RouterA(config-if)# no shutdown (levanta la interfaz) RouterA(config-if)# description red (asigna un nombre a la interfaz) RouterA(config-if)# exit RouterA(config)# * Tener en cuenta que el nmero de interfaz puede ser 0, 1, 0/0, 0/1, etc. Esto vara segn el router. CONFIGURAR INTERFACES SERIAL COMO DCE RouterB> enable RouterB# config terminal RouterB(config)# interface serial 0/1 * (ingresa al Submodo de Configuracin de Interfaz)

RouterB(config-if)# interfaz) RouterB(config-if)# enlaces) RouterB(config-if)# RouterB(config-if)# RouterB(config-if)# RouterB(config)#

ip address 10.0.0.2 255.0.0.0 (configura la IP en la clock rate 56000 (configura la sincronizacin entre los no shutdown (levanta la interfaz) description red (asigna un nombre a la interfaz) exit

* Tener en cuenta que el nmero de interfaz puede ser 0, 1, 0/0, 0/1, etc. Esto vara segn el router.

http://www.networking.com.py/?p=62

You might also like