Router on a stick with DSL config

Simple topology

Router and Switch

A router acting as the gateway for VLAN 10 20 and 30

Switch acting just Layer 2

Topology :

High level config :

ROUTER – basic config :

ip dhcp excluded-address 192.168.10.240 192.168.10.253
ip dhcp excluded-address 192.168.20.240 192.168.20.253
ip dhcp excluded-address 192.168.30.240 192.168.30.253

!
ip dhcp pool LAN1-DHCP
import all
network 192.168.10.0 255.255.255.0
default-router 192.168.10.254
dns-server 8.8.8.8 8.8.4.4
lease 7
!
ip dhcp pool LAN2-DHCP
import all
network 192.168.20.0 255.255.255.0
default-router 192.168.20.254
dns-server 8.8.8.8 8.8.4.4
lease 7
!
ip dhcp pool LAN3-DHCP
import all
network 192.168.30.0 255.255.255.0
default-router 192.168.30.254
dns-server 8.8.8.8 8.8.4.4
lease 7
!
!
interface GigabitEthernet0
no ip address
no shutdown
!
interface GigabitEthernet0.10
encapsulation dot1Q 10
ip address 192.168.10.254 255.255.255.0
ip nat inside
no shutdown
!
interface GigabitEthernet0.20
encapsulation dot1Q 20
ip address 192.168.20.254 255.255.255.0
ip nat inside
no shutdown
!
interface GigabitEthernet0.30
encapsulation dot1Q 30
ip address 192.168.30.254 255.255.255.0
ip nat inside
no shut
!
interface Dialer0
ip nat outside
!
ip route 0.0.0.0 0.0.0.0 Dialer0
!
!
access-list 100 permit ip 192.168.10.0 0.0.0.255 any
access-list 100 permit ip 192.168.20.0 0.0.0.255 any
access-list 100 permit ip 192.168.30.0 0.0.0.255 any
!
ip nat inside source list 100 interface dialer0 overload

SWITCH – basic config

config t
!
vlan 10,20,30
!
interface gig1/0/1
Description connecting to Router Gig0
switchport trunk encapsulation dot1q
switchport mode trunk
no shutdown
!
interface gig1/0/2
switchport mode access
switchport access vlan 10
!
interface gig1/0/3
switchport mode access
switchport access vlan 20
!
interface gig1/0/4
switchport mode access
switchport access vlan 30

If you like switch management using vlan 10

interface vlan 10
ip address 192.168.10.253 255.255.255.0
no shutdown
!
ip default-gateway 192.168.10.254

happy labbing ………………….!