03-13-2023 02:04 AM
PFA for your reference
in SW
interface FastEthernet0/1
switchport trunk allowed vlan 1,10,20
switchport mode trunk
!
interface FastEthernet0/2
switchport access vlan 10
switchport mode trunk
!
interface FastEthernet0/3
switchport access vlan 20
switchport mode trunk
!
interface Vlan1
no ip address
shutdown
!
!
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
ROUTER
p dhcp excluded-address 10.1.10.1 10.1.10.99
ip dhcp excluded-address 10.1.20.1 10.1.20.99
!
ip dhcp pool VLAN10
network 10.1.10.0 255.255.255.0
default-router 10.1.10.1
dns-server 10.1.10.1
ip dhcp pool VLAN20
network 10.1.20.0 255.255.255.0
default-router 10.1.20.1
dns-server 10.1.20.1
03-13-2023 02:37 AM - last edited on 03-13-2023 04:36 AM by rupeshah
PFA for your reference
SW0:
interface FastEthernet0/1
switchport access vlan 10
switchport mode access
duplex full
speed 100
!
interface FastEthernet0/2
switchport access vlan 20
switchport mode trunk
duplex full
speed 100
!
interface FastEthernet0/3
switchport trunk allowed vlan 1,10,20
switchport mode access
!
interface Vlan1
ip address 172.1.0.5 255.255.255.224
!
banner motd ^C***********WARNING**************
THIS SWITCH GOING TO DOWN ON SATUDAY FOR SERVICE^C
!
!
!
access-list 1 permit host 172.1.0.2
line con 0
login local
!
line vty 0 4
access-class 1 in
login local
BRANCH:
Current configuration : 1822 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Branch
!
!
!
enable secret 5 xxx
!
!
ip dhcp excluded-address 10.1.10.1 10.1.10.99
ip dhcp excluded-address 10.1.20.1 10.1.20.99
!
!
!
!
ip cef
no ipv6 cef
!
!
!
username xxx secret 5 xxx
!
!
license udi pid xxx sn xxx
!
!
!
!
!
!
!
!
!
ip ssh version 2
ip domain-name cisco.com
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation dot1Q 1 native
ip address 10.1.1.1 255.255.255.0
!
interface FastEthernet0/0.10
encapsulation dot1Q 10
ip address 10.1.10.1 255.255.255.0
ip helper-address 172.1.0.62
!
interface FastEthernet0/0.20
encapsulation dot1Q 20
ip address 10.1.20.1 255.255.255.0
ip helper-address 172.1.0.62
!
interface FastEthernet0/0.30
no ip address
!
interface FastEthernet0/1
ip address 209.165.201.11 255.255.255.224
ip nat outside
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
router rip
!
ip classless
ip route 172.1.0.32 255.255.255.224 172.1.0.33
ip route 0.0.0.0 0.0.0.0 172.1.0.32
ip route 172.1.0.32 255.255.255.252 172.1.0.66
ip route 0.0.0.0 0.0.0.0 209.165.201.12
!
ip flow-export version 9
!
!
access-list 1 permit host 172.1.0.2
!
banner login ^C****************warning**************
unathuraized to login this device only autherized person can login^C
!
!
!
!
line con 0
login local
!
line aux 0
!
line vty 0 4
access-class 1 in
login local
transport input ssh
transport output none
line vty 5
access-class 1 in
login local
transport input ssh
transport output none
line vty 6 15
access-class 1 in
login
!
!
ntp server 172.1.0.62
!
end
HQ:
hostname HQ
!
!
!
enable secret 5 xxx
!
!
ip dhcp excluded-address 172.1.0.1 172.1.0.66
!
ip dhcp pool WAN
network 172.1.0.0 255.255.255.224
default-router 172.1.0.66
!
!
!
ip cef
no ipv6 cef
!
!
!
username xxx secret 5 xxx
!
!
license udi pid xxx sn xxx
!
!
!
!
!
!
!
!
!
ip ssh version 2
ip domain-name cisco.com
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
ip address 209.165.201.12 255.255.255.224
ip access-group NO_WEB in
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 172.1.0.33 255.255.255.224
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 172.1.0.1
ip route 0.0.0.0 0.0.0.0 172.1.0.65
ip route 172.1.0.0 255.255.255.252 172.1.0.1
ip route 172.1.0.0 255.255.255.224 172.1.0.65
ip route 172.1.0.0 255.255.255.224 172.1.0.67
ip route 10.1.10.0 255.255.255.0 209.165.201.11
ip route 10.1.20.0 255.255.255.0 209.165.201.11
!
ip flow-export version 9
!
!
ip access-list extended NO_WEB
deny tcp host 172.1.0.3 host 172.1.0.62 eq www
permit ip any any
!
!
!
!
!
line con 0
login local
!
line aux 0
!
line vty 0 4
access-class 1 in
login local
transport input telnet
transport output ssh
line vty 5
access-class 1 in
login local
transport input telnet
transport output ssh
line vty 6 15
login
transport input telnet
!
!
ntp authentication-key 1 md5 0822455D0A16 7
ntp authenticate
ntp server 172.1.0.62 key 1
!
end
DHCP SERVER:
03-13-2023 02:44 AM
You need to post the Router full config, - since we see basic config of switch, as trunk and allowed VLAN in the Trunk, but we have not see same config is applied on the router side ?
03-13-2023 03:56 AM - last edited on 03-13-2023 04:45 AM by rupeshah
Router#sh runn
Building configuration...
Current configuration : 1161 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
ip dhcp excluded-address 10.1.10.1 10.1.10.99
ip dhcp excluded-address 10.1.20.1 10.1.20.99
!
ip dhcp pool VLAN10
network 10.1.10.0 255.255.255.0
default-router 10.1.10.1
dns-server 10.1.10.1
ip dhcp pool VLAN20
network 10.1.20.0 255.255.255.0
default-router 10.1.20.1
dns-server 10.1.20.1
!
!
!
ip cef
no ipv6 cef
!
!
!
!
license udi pid CISCO2811/K9 sn xxx
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation dot1Q 10
ip address 10.1.10.1 255.255.255.0
!
interface FastEthernet0/0.2
encapsulation dot1Q 20
ip address 10.1.20.1 255.255.255.0
!
interface FastEthernet0/0.3
encapsulation dot1Q 1 native
ip address 10.1.1.1 255.255.255.0
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface Vlan1
no ip address
shutdown
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
Switch#sh runn
Building configuration...
Current configuration : 1242 bytes
!
version 15.0
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Switch
!
!
!
!
!
!
spanning-tree mode pvst
spanning-tree extend system-id
!
interface FastEthernet0/1
switchport trunk allowed vlan 1,10,20
switchport mode trunk
!
interface FastEthernet0/2
switchport access vlan 10
switchport mode trunk
!
interface FastEthernet0/3
switchport access vlan 20
switchport mode trunk
!
interface FastEthernet0/4
!
interface FastEthernet0/5
!
interface FastEthernet0/6
!
interface FastEthernet0/7
!
interface FastEthernet0/8
!
interface FastEthernet0/9
!
interface FastEthernet0/10
!
interface FastEthernet0/11
!
interface FastEthernet0/12
!
interface FastEthernet0/13
!
interface FastEthernet0/14
!
interface FastEthernet0/15
!
interface FastEthernet0/16
!
interface FastEthernet0/17
!
interface FastEthernet0/18
!
interface FastEthernet0/19
!
interface FastEthernet0/20
!
interface FastEthernet0/21
!
interface FastEthernet0/22
!
interface FastEthernet0/23
!
interface FastEthernet0/24
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
!
interface Vlan1
no ip address
shutdown
!
!
!
!
line con 0
!
line vty 0 4
login
line vty 5 15
login
!
!
!
!
end
03-13-2023 06:15 AM
Check have you created vlan 10, 20 ?
from switch post below output :
show vlan
show interface status
Router :
show ip interface brief
show ip route
show ip dhcp server statistics
show ip dhcp pool
show ip sockets
-
below reference guide :
03-13-2023 08:06 PM
03-13-2023 04:04 AM
Hello @thirumg3
On your router:
R1(config)#service dhcp
03-13-2023 04:22 AM - last edited on 03-13-2023 04:53 AM by rupeshah
facing the same issue and getting APIPA.
Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#service DHCP
Router(config)#exit
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#wr
Building configuration...
[OK]
Router#sh runn
Building configuration...
Current configuration : 1161 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
ip dhcp excluded-address 10.1.10.1 10.1.10.99
ip dhcp excluded-address 10.1.20.1 10.1.20.99
!
ip dhcp pool VLAN10
network 10.1.10.0 255.255.255.0
default-router 10.1.10.1
dns-server 10.1.10.1
ip dhcp pool VLAN20
network 10.1.20.0 255.255.255.0
default-router 10.1.20.1
dns-server 10.1.20.1
!
!
!
ip cef
no ipv6 cef
!
!
!
!
license udi pid xxx sn xxx
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/0.1
encapsulation dot1Q 10
ip address 10.1.10.1 255.255.255.0
!
interface FastEthernet0/0.2
encapsulation dot1Q 20
ip address 10.1.20.1 255.255.255.0
!
interface FastEthernet0/0.3
encapsulation dot1Q 1 native
ip address 10.1.1.1 255.255.255.0
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
shutdown
!
interface Vlan1
no ip address
shutdown
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
03-13-2023 06:22 AM
ok @thirumg3
do the vlan 10 and 20 are created on the switch ?
sh vlan brief
03-13-2023 07:48 PM
03-13-2023 06:47 AM
show ip dhcp server statistics <<- share this
03-13-2023 08:22 PM
Branch#sh ip dhcp server statistics
^
% Invalid input detected at '^' marker.
03-14-2023 05:02 AM - edited 03-14-2023 05:09 AM
Hello @thirumg3
Thanks for the config.
On SW please only config [switchport mode access] and [switchport access vlan 10] on interface FastEthernet0/2 - do [no switchport mode trunk].
Same thing on interface FastEthernet0/3 ; config [switchport mode access] and [switchport access vlan 20] - do [no switchport mode trunk].
Also you cas add [spanning-tree portfast] command on Fa0/2 and Fa0/3.
Your FastEthernet0/1 seem to be your trunk link towards the router. Config is ok !
Also on the Router interface face to face with the Switch, the config ROAS is ok!
interface Fa0/0
description --To_SW
no shut
!
interface Fa0/0.10
description --Vl10
encapsulation dot1q 10
ip add 10.1.10.1 255.255.255.0
no shut
interface Fa0/0.20
description --Vl20
encapsulation dot1q 20
ip add 10.1.20.1 255.255.255.0
no shut
Please do [show ip int brief] on router and give us the output.
03-15-2023 01:01 AM
Switch#config t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int f0/2
Switch(config-if)#switchmode access vlan 10
^
% Invalid input detected at '^' marker.
Switch(config-if)#switch mode access vlan 10
^
% Invalid input detected at '^' marker.
Switch(config-if)#switch mode access
Switch(config-if)#switch access vlan 10
Switch(config-if)#no switch mode trunk
Command rejected: An interface must be configured to the Access or Trunk modes to be configured to NoNegotiate.
Switch(config-if)#no switchport mode trunk
Command rejected: An interface must be configured to the Access or Trunk modes to be configured to NoNegotiate.
Switch(config-if)#exit
Switch(config)#int f0/2
Switch(config-if)#no switchport mode trunk
Command rejected: An interface must be configured to the Access or Trunk modes to be configured to NoNegotiate.
Switch(config-if)#
Switch(config-if)#exit
Switch(config)#int f0/2
Switch(config-if)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
host. Connecting hubs, concentrators, switches, bridges, etc... to this
interface when portfast is enabled, can cause temporary bridging loops.
Use with CAUTION
%Portfast has been configured on FastEthernet0/2 but will only
have effect when the interface is in a non-trunking mode.
03-15-2023 01:12 AM
Branch#sh ip int brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES manual up up
FastEthernet0/0.1 10.1.1.1 YES manual up up
FastEthernet0/0.10 10.1.10.1 YES manual up up
FastEthernet0/0.20 10.1.20.1 YES manual up up
FastEthernet0/0.30 unassigned YES unset up up
FastEthernet0/1 209.165.201.11 YES manual up up
Vlan1 unassigned YES unset administratively down down
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide