Cisco IOS Routing and Switching Configuration Examples

Classified in Language

Written on in English with a size of 3.73 KB

Cisco IOS Configuration: Basic Device Setup

These commands establish the initial configuration, including hostname, time, and access line settings for Router B2.

Initial Setup Commands


enable
clock set 10:00:00 1 January 2010
show clock
configure terminal
hostname B2
banner motd 'Router B2'
no ip domain-lookup
    

Line Access Configuration


line console 0
history size 35
line vty 0 4
history size 35
    

VLAN and Switching Configuration

Configuration steps for defining VLANs, setting up access ports with security, trunk ports, and the Management SVI.

VLAN Definitions

  • VLAN 10: Cuerpo Docente (Faculty Staff)
  • VLAN 99: ManagementNative

vlan 10
 name "Cuerpo Docente"
vlan 99
 name "ManagementNative"
    

Access Port Configuration (FastEthernet 0/18)

Interface Fa0/18 is configured for VLAN 10 access with strict port security measures.


interface Fa0/18
 switchport mode access
 switchport access vlan 10
 switchport port-security
 switchport port-security maximum 1
 switchport port-security mac-address sticky
 switchport port-security violation shutdown
    

Trunk Port Configuration (FastEthernet 0/1)

Interface Fa0/1 is set up as a trunk, utilizing VLAN 99 as the native VLAN.


interface fa0/1
 switchport mode trunk
 switchport native vlan 99
    

Management SVI Configuration (VLAN 99)

Setting the IP address and default gateway for the Management VLAN interface.


interface vlan 99
 ip address 172.17.99.50 255.255.255.0
 ip default-gateway 172.17.99.254
    

Router-on-a-Stick Subinterface (FastEthernet 0/0.10)

Configuration for the subinterface handling traffic for VLAN 10.


interface fastEthernet0/0.10
 encapsulation dot1q 10
 ip address 172.17.10.254 255.255.255.0
 no shutdown
    

Interface Configuration

Physical interface settings for FastEthernet 0/0 and Serial 0/1/0.

FastEthernet 0/0 (LAN Interface)


interface fa0/0
 ip address 10.1.34.1 255.255.255.128
 speed auto
 duplex auto
    

Serial 0/1/0 (WAN Interface)


interface s0/1/0
 ip address 172.20.0.17 255.255.255.252
 clock rate 64000
 no shutdown
 exit
    

Routing Protocol Configuration

Configuration details for RIPv2, OSPF, and EIGRP, along with necessary static routes.

RIP Version 2 (RIPv2)

RIPv2 setup includes disabling auto-summarization and defining a passive interface. Note that ip route is a global configuration command.


router rip
 version 2
 no auto-summary
 passive-interface Fa0/0
 network [Network Address]
    

OSPF (Open Shortest Path First)

OSPF Process 1 configuration, defining networks within Area 20 and setting a passive interface.


router ospf 1
 passive-interface fa0/1
 network 172.16.52.0 0.0.0.127 area 20
 network 172.16.52.132 0.0.0.3 area 20
 network 10.10.10.0 0.0.0.7 area 20
 exit
    

EIGRP (Enhanced Interior Gateway Routing Protocol)

EIGRP Autonomous System 1 configuration, disabling auto-summarization and defining passive interfaces.


router eigrp 1
 no auto-summary
 passive-interface fa0/0
 passive-interface fa0/1
 network 10.1.32.0 0.0.0.255
 network 10.1.33.0 0.0.0.255
 network 172.20.0.0 0.0.0.3
 network 172.20.0.12 0.0.0.3
 exit
    

Static Routes

Default static routes configured globally for external connectivity.


ip route 0.0.0.0 0.0.0.0 se0/0/0
ip route 0.0.0.0 0.0.0.0 fa0/0
    

Related entries: