Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Community Member

router dhcp problem

Hi guys, currently learning CCNA. Stuck with a small probem. I have a 1760 Router that I have configured as a DHCP server to the VLAN's on my switch. I have followed all the instructions that I have found but unfortunately the switch is just not getting assigned the ip addresses.  Can anyone help me please.

 

Here is my router config

Current configuration : 6971 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname SunrayR
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
!
resource policy
!
mmi polling-interval 60
no mmi auto-configure
no mmi pvc
mmi snmp-timeout 180
ip cef
!        
!
no ip dhcp use vrf connected
ip dhcp excluded-address 192.168.20.1
ip dhcp excluded-address 192.168.30.1
!
ip dhcp pool LAN10
   network 192.168.10.0 255.255.255.0
   default-router 192.168.10.1
!
ip dhcp pool LAN20
   network 192.168.20.0 255.255.255.0
   default-router 192.168.20.1
!
ip dhcp pool LAN30
   network 192.168.30.0 255.255.255.0
   default-router 192.168.30.1
!
!
!
!
!
interface FastEthernet0/0
 no ip address
 speed 100
 full-duplex
!
interface FastEthernet0/0.10
 encapsulation dot1Q 10
 ip address 192.168.10.1 255.255.255.0
 no snmp trap link-status
!
interface FastEthernet0/0.20
 encapsulation dot1Q 20
 ip address 192.168.20.1 255.255.255.0
 no snmp trap link-status
!
interface FastEthernet0/0.30
 encapsulation dot1Q 30
 ip address 192.168.30.1 255.255.255.0
 no snmp trap link-status
!
interface Serial0/0
 no ip address
 shutdown
!
interface Ethernet1/0
 no ip address
 shutdown
 half-duplex
!
!
!
no ip http server
no ip http secure-server
!
!
!
control-plane
!
!
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
 password ********
 logging synchronous
 login
line aux 0
line vty 0 4
 exec-timeout 0 0
 password ********
 logging synchronous
 login
 transport input ssh
line vty 5 15
 exec-timeout 0 0
 password ********
 logging synchronous
 login
 transport input ssh
!
end

 

Special thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Hall of Fame Super Blue

Can you add this to your

Can you add this to your switch config -

int fa0/1

switchport mode trunk 

Jon

21 REPLIES
Green

Hi,If I understand your issue

Hi,

If I understand your issue poperly.
You are talking about the switch itself
not gaining an ip address.

If the switch is in default it will have NO
KNOWLEDGE of any vlans other than VLAN 1, therfore it will
be sending its DHCP discover through vlan 1

Try adding a dhcp pool for vlan 1 and add a dotq interface
for vlan 1


!
!
ip dhcp excluded-address 192.168.10.1
! YOU HAVE MISSED THIS LINE IN YOUR CONFIG FOR VLAN 10
!
!
!
ip dhcp excluded-address 192.168.1.1
ip dhcp pool LAN1
   network 192.168.10.0 255.255.255.0
   default-router 192.168.1.1
!
!
interface FastEthernet0/0.1
 encapsulation dot1Q 1 native
 ip address 192.168.1.1 255.255.255.0
 no snmp trap link-status
!
!

In the real world most network people allocate 
fixed IP addresses to their lan switches as they
are an intgeral part of our data neworks and
we dont want to depend on a network service to allow
us to gain access to manage of fault on the swiches


Hope this helps
Regards
Alex
  

Regards, Alex. Please rate useful posts.
Community Member

Thank you for your advice. I

Thank you for your advice. I will give that a go and let you know if it worked.

hi,could you post your switch

hi,

could you post your switch config?

make sure you've enabled a trunk port and an ip default-gateway configured.

Community Member

Here is my switch config - 

Here is my switch config - 

 

Current configuration:
!
version 12.0
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname SW1
!
enable secret 5 $1$AK3s$K4.bPaZ8QKyxnLYGtAvke.
!
!
!
!
!
!
ip subnet-zero
!
!
!
interface FastEthernet0/1
 duplex full
 speed 100
 switchport trunk encapsulation dot1q
!
interface FastEthernet0/2
 duplex full
 speed 100
 switchport access vlan 10
!
interface FastEthernet0/3
 duplex full
 speed 100
 switchport access vlan 10
!
interface FastEthernet0/4

 duplex full
 speed 100
 switchport access vlan 10
!
interface FastEthernet0/5

 duplex full
 speed 100
 switchport access vlan 20
!
interface FastEthernet0/6

duplex full
 speed 100
 switchport access vlan 20
!
interface FastEthernet0/7

duplex full
 speed 100
 switchport access vlan 20
!
interface FastEthernet0/8

duplex full
 speed 100
 switchport access vlan 30
!         
interface FastEthernet0/9

duplex full
 speed 100
 switchport access vlan 30
!
interface FastEthernet0/10

duplex full
 speed 100
 switchport access vlan 30
!
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 FastEthernet0/25
!
interface FastEthernet0/26
!
interface FastEthernet0/27
!
interface FastEthernet0/28
!
interface FastEthernet0/29
!
interface FastEthernet0/30
!
interface FastEthernet0/31
!         
interface FastEthernet0/32
!
interface FastEthernet0/33
!
interface FastEthernet0/34
!
interface FastEthernet0/35
!
interface FastEthernet0/36
!
interface FastEthernet0/37
!
interface FastEthernet0/38
!
interface FastEthernet0/39
!
interface FastEthernet0/40
!
interface FastEthernet0/41
!
interface FastEthernet0/42
!
interface FastEthernet0/43
!
interface FastEthernet0/44
!
interface FastEthernet0/45
!
interface FastEthernet0/46
!
interface FastEthernet0/47
!
interface FastEthernet0/48
!
interface GigabitEthernet0/1
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface GigabitEthernet0/2
 switchport trunk encapsulation dot1q
 switchport mode trunk
!
interface VLAN1
 no ip directed-broadcast
 no ip route-cache
!         
interface VLAN10
 no ip directed-broadcast
 no ip route-cache
 shutdown
!
interface VLAN20
 no ip directed-broadcast
 no ip route-cache
 shutdown

!

interface VLAN30
 no ip directed-broadcast
 no ip route-cache
 shutdown
!
ip default-gateway 192.168.1.1
!
line con 0
 password ********
 logging synchronous
 login
 transport input none
 stopbits 1
line vty 0 4
 exec-timeout 0 0
 password ********
 logging synchronous
 login    
 transport input telnet
line vty 5 15
 exec-timeout 0 0
 password ********
 logging synchronous
 login
 transport input telnet
!
end

Community Member

Hi Alex, thank you for your

Hi Alex, thank you for your time and your advice, I added your suggestions to the router but still no joy, the switch is still not picking up a valid ip address. sad

Community Member

Hi, You need to configure "ip

Hi,

 

You need to configure "ip helper-address" under the SVIs on the switch.

 

Switch#

conf t

int vlan 10

ip helper-address 192.168.10.1

int vl 20

ip helper-address 192.168.20.1

int vl 30

ip helper-address 192.168.30.1

Community Member

Thank you, i have added that

Thank you, i have added that but still no change.  This is really getting annoying!!

Hall of Fame Super Blue

You don't need "ip helper

You don't need "ip helper-address ..." commands as you are using subinterfaces on the router.

Can you clarify exactly what the problem is ie. -

1) are clients connected to the switch not getting IPs

or

2) is it the switch itself not getting an IP

which port on your switch connects to the router ?

Jon

Community Member

I thought that was strange to

I thought that was strange to add the IP helper-address command as my switch is not layer 3. The client device, my laptop, is not picking up an ip address. As for the switch picking up an address, I'm not sure.I did give my vlan 1 a static IP address of 192.168.1.2 on my switch. Port 1 in my switch which is in native vlan 1 is connected to fa0/0 on the router.
Hall of Fame Super Blue

Okay, let forget about the

Okay, lets forget about the switch and concentrate on the clients.

Can you post from the switch -

1) "sh int trunk" from the switch

2) "sh vlan brief"

Jon

Community Member

SW1#show int fa0/1 switchport

SW1#show int fa0/1 switchport 
Name: Fa0/1
Switchport: Enabled
Administrative mode: static access
Operational Mode: static access
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Disabled
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 1 (default)
Trunking VLANs Enabled: NONE
Pruning VLANs Enabled: NONE

Priority for untagged frames: 0
Override vlan tag priority: FALSE
Voice VLAN: none
Appliance trust: none
Self Loopback: No

 

SW1#show vlan br 
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Fa0/1, Fa0/4, Fa0/5, Fa0/6,
                                                Fa0/7, Fa0/8, Fa0/9, Fa0/10,
                                                Fa0/11, Fa0/12, Fa0/13, Fa0/14,
                                                Fa0/15, Fa0/16, Fa0/17, Fa0/18,
                                                Fa0/19, Fa0/20, Fa0/21, Fa0/22,
                                                Fa0/23, Fa0/24, Fa0/25, Fa0/26,
                                                Fa0/27, Fa0/28, Fa0/29, Fa0/30,
                                                Fa0/31, Fa0/32, Fa0/33, Fa0/34,
                                                Fa0/35, Fa0/36, Fa0/37, Fa0/38,
                                                Fa0/39, Fa0/40, Fa0/41, Fa0/42,
                                                Fa0/43, Fa0/44, Fa0/45, Fa0/46,
                                                Fa0/47, Fa0/48
10   VLAN0010                         active    Fa0/2, Fa0/3
20   VLAN0020                         active    
30   VLAN0030                         active    
1002 fddi-default                     active    
1003 token-ring-default               active    
1004 fddinet-default                  active    
1005 trnet-default                    active  

 

 

Hall of Fame Super Blue

Can you add this to your

Can you add this to your switch config -

int fa0/1

switchport mode trunk 

Jon

Community Member

Well not sure what happened

Well not sure what happened Jon but as you can see in the above post, fa0/1 on the switch is configured as a trunk link. But as you requested, I retyped the command:

 

int fa0/1

switchport mode trunk

 

and Voilà. It's all come up.  Thank you so much for all your help.  Very very very much appreciated.  

Hall of Fame Super Blue

No problem.Looking at yout

No problem.

Just to clarify though, if you look at the switch config you posted it wasn't configured as a trunk because you had just entered the encapsulation type and not the actual mode of the port.

If you also look at the output of the "sh int ...." command you posted you can see that it was acting as an access port.

So it was only after you entered the "switchport mode trunk" command that it changed to a trunk link.

Jon

Community Member

Again thank you so much.

Again thank you so much.  Would have taken me forever to spot that.  Hopefully.....on day.......i get to be half as good as some of guys on here. One hurdle complete 1001 lef to go.

Hall of Fame Super Blue

Port 1 in my switch which is

Port 1 in my switch which is in native vlan 1 is connected to fa0/0 on the router.

Not sure what you mean by this ie. the port should be configured as a trunk.

Which specific port on the switch connects to the router ?

Also which port is the client connected to ?

Jon

Community Member

Sorry my mistake. fa0/1 on

Sorry my mistake. fa0/1 on the switch is configured as a dot1q trunk and connected to fa0/0 on the router.  The client pc is connected to fa0/2 on the switch which is configured as an access port and in vlan10.

Community Member

I just checked your switch

I just checked your switch configuration. you need to assign an IP address to each SVIs. Assign .2 IP address on each SVI.

 

ROUTER <----> SWITCH

Router will be tagging VLAN 10,20,30 traffic and using .1 IP address

Your switch also needs to tag the traffic and send it to Router using SVIs.

 

Also, do not use 'ip default-gateway' -> this is for L2 switch

Use 'ip route 0.0.0.0 0.0.0.0 next-hop' for L3 switches

 

Thanks,

G1

Hall of Fame Super Blue

The router is doing the inter

The router is doing the inter vlan routing not the switch so -

1) the SVIs should be left shutdown and do not need IP addresses

2) you should use "ip default-gateway" because the switch is acting as a L2 switch and not L3

Jon

Community Member

I realised that and removed

I realised that and removed the IP helper-address commands. I did set the default gateway to 192.168.1.1 which is the IP address of fa0/0.1 on the router.
Community Member

My equipment consists of a

My equipment consists of a cisco 1760 router and a cisco layer '2' switch, so svi's are not an option.

336
Views
15
Helpful
21
Replies
CreatePlease to create content