Static and Dynamic Routing Configuration
Static routes: manually configured routes — 'ip route 192.168.2.0 255.255.255.0 10.0.0.2' on a Cisco router (destination network, mask, next-hop IP). Advantages: predictable, no overhead, no convergence time. Disadvantages: no failover (if the next-hop is down, traffic is dropped), manual updates required when topology changes. Default static route: 'ip route 0.0.0.0 0.0.0.0 [next-hop]' — matches any destination not in the routing table, used for internet access.
Dynamic routing protocols: OSPF, EIGRP, RIP, BGP. Configuration involves enabling the protocol, defining which networks to advertise, and setting parameters. OSPF: 'router ospf 1' → 'network 10.0.0.0 0.0.0.255 area 0' — advertises all interfaces in the 10.0.0.0/24 range into OSPF area 0. Administrative distance (AD): router's trust level for routes from different sources — directly connected = 0, static = 1, OSPF = 110, RIP = 120, external BGP = 20.
Routing table: the router selects the best route using: longest prefix match first (most specific route wins — /28 beats /24 beats default route), then lowest AD, then lowest metric. Always verify routes with 'show ip route' — understand each entry: C (connected), S (static), O (OSPF), R (RIP), B (BGP).
Route redistribution: importing routes from one routing protocol into another. Requires careful configuration to avoid routing loops and metric translation issues. Redistribution points are where different routing domains meet.
Inter-VLAN Routing
Router-on-a-stick: one physical router interface, multiple sub-interfaces — each sub-interface carries a VLAN using 802.1Q encapsulation. 'interface GigabitEthernet0/0.10' → 'encapsulation dot1q 10' → 'ip address 192.168.10.1 255.255.255.0'. The connected switch port must be configured as a trunk. One physical connection between router and switch handles all VLANs. Bandwidth bottleneck for inter-VLAN traffic at high volume.
Layer 3 switch (SVI — Switched Virtual Interface): the modern, high-performance approach to inter-VLAN routing. Create an SVI for each VLAN: 'interface Vlan10' → 'ip address 192.168.10.1 255.255.255.0' → 'no shutdown'. Enable IP routing: 'ip routing'. Layer 3 switches route in hardware (ASIC) — much faster than router-on-a-stick. Best practice for data center and campus inter-VLAN routing.
DHCP helper address: when a router provides inter-VLAN routing and subnets have remote DHCP servers, configure IP helper to forward DHCP broadcasts as unicast: 'ip helper-address [DHCP server IP]' on each Layer 3 interface/SVI that serves a subnet with DHCP clients.
Router Security and Access
Console and VTY access: routers have a console port (direct serial connection), AUX port (modem access), and VTY lines (virtual terminals — SSH/Telnet). Always configure SSH instead of Telnet: 'transport input ssh' on VTY lines. Set enable secret (MD5 hashed) not enable password (cleartext). Configure a login banner: 'banner motd' — legal requirement in many organizations.
AAA (Authentication, Authorization, Accounting): centralizes access control. Configure routers to authenticate admin access via RADIUS or TACACS+ server: RADIUS encrypts only the password; TACACS+ encrypts the entire packet and separates authentication, authorization, and accounting. TACACS+ is preferred for device administration; RADIUS for network access (VPN, 802.1X).
Control Plane Policing (CoPP): limits traffic destined for the router's CPU. Without CoPP, a flood of routing protocol packets or management traffic can overwhelm the CPU. CoPP uses QoS policy maps to rate-limit different traffic types to the control plane.
ACLs on router interfaces: standard ACLs (match source IP only) — place as close to destination as possible. Extended ACLs (match source, destination, port, protocol) — place as close to source as possible. 'ip access-group ACL-NAME in|out' applies ACL to an interface. Implicit deny at end of every ACL — always verify what is permitted before applying.