// Template
Cisco branch edge router configuration
A commented template for a small-site router — router-on-a-stick VLANs, DHCP, PAT to the internet, a guest ACL and hardened management. Replace every value in angle brackets.
1 min read#ccna#router#nat#dhcp#template
! ===== Identity and management =====
hostname <BRANCH-R1>
no ip domain-lookup
ip domain-name <example.local>
service password-encryption
enable secret <ENABLE-SECRET>
username <admin-user> privilege 15 secret <ADMIN-SECRET>
banner motd # Authorised access only. Activity is logged. #
!
! ===== LAN: router-on-a-stick =====
interface GigabitEthernet0/0/0
description Trunk to access switch
no ip address
no shutdown
interface GigabitEthernet0/0/0.10
description STAFF
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
ip nat inside
interface GigabitEthernet0/0/0.20
description GUEST
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0
ip access-group GUEST-IN in
ip nat inside
interface GigabitEthernet0/0/0.99
description MGMT
encapsulation dot1Q 99
ip address 192.168.99.1 255.255.255.0
!
! ===== WAN =====
interface GigabitEthernet0/0/1
description Internet - <ISP name / circuit ID>
ip address <203.0.113.2> <255.255.255.252>
ip nat outside
no ip redirects
no ip unreachables
no ip proxy-arp
no shutdown
ip route 0.0.0.0 0.0.0.0 <203.0.113.1>
!
! ===== DHCP =====
ip dhcp excluded-address 192.168.10.1 192.168.10.20
ip dhcp excluded-address 192.168.20.1 192.168.20.20
ip dhcp pool STAFF
network 192.168.10.0 255.255.255.0
default-router 192.168.10.1
dns-server <DNS-SERVER-IP>
lease 1
ip dhcp pool GUEST
network 192.168.20.0 255.255.255.0
default-router 192.168.20.1
dns-server <PUBLIC-DNS-IP>
lease 0 4
!
! ===== NAT (PAT) =====
ip access-list standard NAT-INSIDE
permit 192.168.10.0 0.0.0.255
permit 192.168.20.0 0.0.0.255
ip nat inside source list NAT-INSIDE interface GigabitEthernet0/0/1 overload
!
! ===== Guest isolation =====
ip access-list extended GUEST-IN
permit udp any any eq bootps
permit udp 192.168.20.0 0.0.0.255 any eq domain
deny ip 192.168.20.0 0.0.0.255 192.168.0.0 0.0.255.255
deny ip 192.168.20.0 0.0.0.255 host <203.0.113.2>
permit tcp 192.168.20.0 0.0.0.255 any eq www
permit tcp 192.168.20.0 0.0.0.255 any eq 443
deny ip any any log
!
! ===== Services =====
no ip http server
no ip http secure-server
ntp server <NTP-SERVER-IP>
logging host <SYSLOG-SERVER-IP>
service timestamps log datetime msec localtime
!
! ===== Remote access =====
! Run once in exec mode: crypto key generate rsa modulus 2048
ip ssh version 2
ip access-list standard MGMT-SSH
permit 192.168.99.0 0.0.0.255
line con 0
login local
exec-timeout 10 0
logging synchronous
line vty 0 4
login local
transport input ssh
access-class MGMT-SSH in
exec-timeout 10 0
!
endMatches the design used in CCNA labs 8 and 9. Check every interface name and address before using it on a real device.