Benutzer-Werkzeuge

Webseiten-Werkzeuge


ne:cisco

Cisco

Router

Login & Password

Router(config)# security passwords min-length 10
Router(config)# login block-for 100 attempts 2 within 100

Zugriff per SSH

Router(config)# hostname name
Router(config)# ip domain-name name
Router(config)# crypto key generate rsa
Router(config)# ip ssh [time-out seconds | authentication-retries integer]
Router(config)# ip ssh version 2

Beim Einloggen gibt es teilweise Probleme mit neueren SSH-Versionen, da teilweise Algorithmen nicht mehr unterstützt werden. Diese können z.B. in der /etc/ssh/ssh_config oder ~/.ssh/config hinzugefügt werden:

echo 'KexAlgorithms diffie-hellman-group-exchange-sha1, diffie-hellman-group14-sha1' >> /etc/ssh/ssh_config
echo 'HostKeyAlgorithms ssh-rsa' >> /etc/ssh/ssh_config

Login direkt in den privilegierten Modus

Router(config)# user cisco privilege 15 secret cisco123!

Router(config)# aaa new-model
Router(config)# aaa authentication login default local
Router(config)# aaa authorization exec default local

Proxy ARP

Proxy-ARP zwischen Subnetzen ist auf Cisco-Routern standardmäßig eingeschaltet und muss aktiv ausgeschalten werden:

Router(config)# interface ethernet 0
Router(config-if)# no ip proxy-arp

Default Route


DHCP

DHCP Pool auf Cisco Router erstellen

ip dhcp pool Management
   network 10.10.0.0 255.255.255.0
   default-router 10.10.0.1

Statische Route per DHCP verteilen

ip dhcp pool 0
   option 121 ip 24.192.168.30 192.168.10.1
   option 249 ip 24.192.168.30 92.168.10.1

https://community.cisco.com/t5/switching/cisco-ios-dhcp-server-classless-static-routes-on-dhcp-clients/td-p/1783721

Anatomy of an Option 121 Packet

Option 121 data is sent as a string of hexadecimal bytes. It format follows a strict pattern for each route:

  1. Width (1 byte): The subnet mask in CIDR notation (e.g., 24 for a 255.255.255.0 mask).
  2. Destination IP (variable length): The target network.
    Trick: It only includes the bytes required by the subnet mask. If it's a /24, it sends 3 bytes. If it's a /8, it only sends 1 byte!
  3. Router IP (4 bytes): The gateway address that knows how to get to that destination.
  4. Cisco supports up to 10 routes, they are just concatenated together

Example: You want to tell a client: „To get to network 10.0.0.0/8, use the gateway 192.168.1.254.“
The hex payload would look like this:

08 0A C0 A8 01 FE
  > 08: The subnet mask (/8).
  > 0A: The destination network (10 in hex). Because it's a /8, it only needs one byte.
  > C0 A8 01 FE: The gateway IP (192.168.1.254 in hex).

DHCP-lease erneuern

alternativ Interface auf Switch aus und anschalten (shut/no shut).

Windows:

ipconfig /release
ipconfig /renew 

Mac:

sudo ipconfig set en0 DHCP
ipconfig getpacket en0  #check DHCP config
networksetup -listallhardwareports #lists installed NICs

http://osxdaily.com/2015/07/30/release-renew-dhcp-command-line-ipconfig/


NAT

Overload the interface IP address of the outside interface, allow all hosts behind the inside interface to access the NAT:

R1# configure terminal
R1(config)# interface gigabitEthernet0/0/1
R1(config-if)# ip nat inside
R1(config)# interface gigabitEthernet0/1/0
R1(config-if)# ip nat outside
R1(config)# access-list 10 remark == [Control NAT Access] ==
R1(config)# access-list 10 permit 192.168.0.0 0.0.0.255 any
R1(config)# ip nat inside source list 10 interface gigabitEthernet 0/0/1 overload 

Show NAT status:

R1# show ip nat translations

NETCONF & RESTCONF

Router(config)# username admin privilege 15 secret cisco123!
Router(config)# netconf

Router(config)# ip http secure-server 
Router(config)# restconf

Switch

Inter-VLAN Routing

Spanning Tree

Spanning Tree Protokoll für einzelne VLANs ausschalten:

 no spanning-tree vlan vlan-id

Verschiedenes

Cisco Discovery Protocol auf dem Interface ausschalten:

switch(config-if)# no cdp enable

Proxy ARP global auf dem Router ausschalten:

router(config)# ip arp proxy disable 

Running Config komplett ersetzen

Router# configure replace nvram:startup-config

Booting a Different IOS Image

Upgrading an IOS Image (ISR4221)

Router# copy usb0:isr4200-universalk9_ias.16.12.06.SPA.bin bootflash:
Router# verify bootflash:isr4200-universalk9_ias.16.12.06.SPA.bin

Router(config)# boot system flash bootflash:isr4200-universalk9_ias.16.12.06.SPA.bin
Router# wr
Router# show boot       --> zeigt den aktuellen Wert der Boot-Variablen an
Router# reload

Updating Cisco ROM Monitor

Show rom-monitor version (ISR4221):

 Router# show rom-monitor r0
 Router# show platform

Upgrade rom-monitor (ISR4221):

 Router#upgrade rom-monitor file usb0:isr4200_4300_rommon_1612_2r_SPA.pkg all
 Router#reload

Upgrade rom-monitor (C1841):

 Router# upgrade rom-monitor file usbflash0:C1841_RM2.srec.124-13r.T5

Cisco Configuration Syntax Highlighting

enable secret / enable password

Beide Befehle können gleichzeitig in der Konfiguration stehen.
enable secret hat Vorrang vor enable password

Wenn bei beiden Befehlen das gleiche Passwort verwendet wird, erhält der Benutzer eine Fehlermeldung. Dass Passwort wird aber trotzdem gesetzt.

Diese Website verwendet Cookies. Durch die Nutzung der Website stimmen Sie dem Speichern von Cookies auf Ihrem Computer zu. Außerdem bestätigen Sie, dass Sie unsere Datenschutzbestimmungen gelesen und verstanden haben. Wenn Sie nicht einverstanden sind, verlassen Sie die Website.Weitere Information
ne/cisco.txt · Zuletzt geändert: von admin