cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
11732
Views
70
Helpful
30
Replies

Cisco C2960 can't get ip through DHCP.

Frika
Level 1
Level 1

Hi, I have been trying to learn how to work with Cisco switches for little bit less than a week so far so keep that in mind. So my task for the day was to create a basic network with 2 siwtches c2960 c3560g and 2 pcs [1 for each switch] who are part of vlan 1 seeing each other and being able to be pinged?? Said network is taking ips from a dhcp router. The issue is that my second switch c2960 doesn't want to get an ip from the dhcp and i ended up spending the majority of my day trying to resolve that problem.

First I want to point out that I have 0 problems with setting up the C3560G switch. It got an ip adress it gave it to the connected pc and everything worked perfectly. The second switch however was a totally different story. It couldn't ping the first switch through the working trunk [but it did detect it mac/ip connection wise] and when my supervisor came around he suggested to move the cable going to the dhcp router from the other switch to the problematic c2960 so it can take an ip. The issue is that it didn't.

 

I put a static ip address and i could see that a connection is being made through port fe0/5 but again no pings are going through. I tried the ip helper command in order to add the router's ip but that didn't work as well. I reset the switch multiple times to factory settings in case there were some old settings that were in the way but that didn't help as well. All and all at this point I am out of ideas of what to do and since my knowledge on the subject is very limited... I am hoping that maybe someone can give me a hand...? Any help would be welcome and thank you in advance.

 

!
version 12.2
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname dianel2
!
boot-start-marker
boot-end-marker
!
no aaa new-model
system mtu routing 1500
ip subnet-zero
!
crypto pki trustpoint TP-self-signed-2366857856
enrollment selfsigned
subject-name cn=IOS-Self-Signed-Certificate-2366857856
revocation-check none
rsakeypair TP-self-signed-2366857856
!
crypto pki certificate chain TP-self-signed-2366857856
certificate self-signed 01
!
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
interface FastEthernet0/1
!
interface FastEthernet0/2
switchport trunk allowed vlan 1
switchport mode trunk
!
interface FastEthernet0/3
!
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
ip address dhcp
!
ip http server
ip http secure-server
!
control-plane
!
line con 0
line vty 0 4
login
line vty 5 15
login
!
end

1 Accepted Solution

Accepted Solutions

Hello Bob
No need to apologize I am fully aware how exasperating troubleshooting can be, especially when your new to networking switches etc..
If you again obtain a need to come back to this problem please don’t hesitate, We would be happy to assist further.

.


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

View solution in original post

30 Replies 30

balaji.bandi
Hall of Fame
Hall of Fame

I do not see any issue on the config high levle., Who is your DHCP Server ? or do you have DHCP Server connected to switch ?

 

 

interface FastEthernet0/2
switchport trunk encapsulation dot1q
switchport mode trunk
!
!
interface Vlan1
ip address dhcp

 

You should able to get IP address for VLAN 1 ? you can see show ip interface brief? is that working first ? (before you connect tghe device on port fa 0/5)

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

For the moment i want to focus entirely on making C2960 work so let us forget and ignore any trunks etc for the time being and focus on the scenario where my dhcp server is another switch and that comes into port 0/5.

 

I wasn't able to get any IP from the trunk for vlan 1.

Here is what i get after 'show ip interface brief': [currently the pc on port 3 is shut down but i can turn it on if it is needed]

Interface IP-Address OK? Method Status Protocol
Vlan1 unassigned YES DHCP up up
FastEthernet0/1 unassigned YES unset down down
FastEthernet0/2 unassigned YES unset down down
FastEthernet0/3 unassigned YES unset down down
FastEthernet0/4 unassigned YES unset down down
FastEthernet0/5 unassigned YES unset up up
FastEthernet0/6 unassigned YES unset down down
FastEthernet0/7 unassigned YES unset down down
FastEthernet0/8 unassigned YES unset down down
FastEthernet0/9 unassigned YES unset down down
FastEthernet0/10 unassigned YES unset down down
FastEthernet0/11 unassigned YES unset down down
FastEthernet0/12 unassigned YES unset down down
FastEthernet0/13 unassigned YES unset down down
FastEthernet0/14 unassigned YES unset down down
FastEthernet0/15 unassigned YES unset down down
FastEthernet0/16 unassigned YES unset down down
FastEthernet0/17 unassigned YES unset down down
FastEthernet0/18 unassigned YES unset down down
FastEthernet0/19 unassigned YES unset down down
FastEthernet0/20 unassigned YES unset down down
FastEthernet0/21 unassigned YES unset down down
FastEthernet0/22 unassigned YES unset down down
FastEthernet0/23 unassigned YES unset down down
FastEthernet0/24 unassigned YES unset down down
GigabitEthernet0/1 unassigned YES unset down down
GigabitEthernet0/2 unassigned YES unset down down

 

I am not sure i get what you mean by 'is that working first ? ' - If your question is if I was getting ip from the trunk the whole issue started from there and I was unable to get IP at any point from anywhere for c2960. I thought i wasn't doing something right but configuring such a simple set up is pretty straight forward [not a lot of commands or things to screw up].

 

I think for the time being it would be better to identify the issue with simply making the C2960 work with a simple setup of it getting an ip by dhcp from another switch and 1 user being connected to the c2960 [pc] which also gets an ip.

 

Let me know if you need anything else info wise and thank you for your time.

Then try below config on switch :

 

config 

!

ip dhcp excluded-address 10.1.100.1 10.1.100.100

!
ip dhcp pool vlan1
network 10.1.100.0 255.255.255.0
default-router 10.1.100.1

!

interface vlan 1

ip address 10.1.100.1 255.255.255.0

no shutdown

 

Now connect device fas 0/5 , shut and no shut the port device get IP address.

 

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

OK... so that worked and correct me if I am wrong but you are basically creating a dhcp pool and telling the switch to give away ips within those 100 ips. How is that helping me identify the reason why my C2960 is not getting dhcp from another outside switch ?

 

At the very least now I know the switch can perform some basic functions now all that is left is to make it work with other networks.

This is where my original question was asked 

 

I do not see any issue on the config high levle., Who is your DHCP Server ? or do you have DHCP Server connected to switch ?

BB

***** Rate All Helpful Responses *****

How to Ask The Cisco Community for Help

Hello,

 

for the (trunk) link between the two switches, are you using a cross cable ? Your IOS is very old, so you probably do not have the 'auto mdix' interface command. Make sure you use a crossover cable to connect the 3560G to the C2960.

Good idea... but that is not the issue :

Auto-MDIX : On [AdminState=1 Flags=0x00052248]

 

This is just me and again ... totally new to this but ideally i can find other switches and their macs on the network which means that information is being exchange which leads me to believe that if the cable was mixed up one way or another i wasn't going to be able to get any info out of anything... right?

 

Anyway thanks for taking the time to give me a hand

Hello,

 

I think even with the wrong cable you would still get a MAC address and CDP info. Either way that is apparently not the problem. Do you have the 3560 config ? You must be missing something basic...

Right now i have totally stopped dealing with the 3560 switch since everything is working fine there. I am thinking within the lines of 'Whatever the issue is with c2960 not getting a dhcp from another switched when connected with a cable is most likely the same cause of the c2960 not getting ip through the trunk from the c3560g' so what I am trying to do is to make the c2960 take an ip by dhcp. Balaji above suggested to turn the c2960 into dhcp server which worked. It gave ip to the pc connected to it etc however this is not helping me in general since I already have a dhcp switch which will give away ips.

 

IF it was something simple wouldn't it be resolved by resetting the 2960 to default settings? I am using the same commands(with some minor differences when needed ofc[names of the sw etc]) for 2960 and for the 3560 when i am setting them up. If the commands are working for one of them ... but not on the other the issue must be within the 2960 start up settings [that is the way i see it anyway] but there are hardly any differences when you factory reset the switch. To say the least... I all i have to do for the 3560 to take ip by dhcp is go: conf

!interface vlan 1

!ip address dhcp

!no shutdown

!end

 

I know i am new to this but this seems pretty straight forward...

 

I will try and get a proper cable if i can... just to be on a safe side.

Hello,

 

post the 3560G switch config anyway, maybe we can spot something...

Sure mate here you go:

 

 


! Last configuration change at 03:43:35 UTC Mon Mar 1 1993
!
version 15.0
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname dianel
!
boot-start-marker
boot-end-marker
!
!
username dianel privilege 15 password 0 dianel
username dianel2 privilege 10 secret 5 $1$oyjT$bM9LKqn6XfBn.NIm8Yaa61
no aaa new-model
system mtu routing 1500
ip routing
!
!
!
!
crypto pki trustpoint TP-self-signed-2711940992
enrollment selfsigned
subject-name cn=IOS-Self-Signed-Certificate-2711940992
revocation-check none
rsakeypair TP-self-signed-2711940992
!!
spanning-tree mode pvst
spanning-tree extend system-id
!
vlan internal allocation policy ascending
!
interface GigabitEthernet0/1
!
interface GigabitEthernet0/2
switchport trunk encapsulation dot1q

switchport trunk allowed vlan 1
switchport mode trunk
switchport port-security maximum 3
!
interface GigabitEthernet0/3
!
interface GigabitEthernet0/4
!
interface GigabitEthernet0/5
!
interface GigabitEthernet0/6
!
interface GigabitEthernet0/7
!
interface GigabitEthernet0/8
!
interface GigabitEthernet0/9
!
interface GigabitEthernet0/10
!
interface GigabitEthernet0/11
!
interface GigabitEthernet0/12
!
interface GigabitEthernet0/13
!
interface GigabitEthernet0/14
!
interface GigabitEthernet0/15
!
interface GigabitEthernet0/16
!
interface GigabitEthernet0/17
!
interface GigabitEthernet0/18
!
interface GigabitEthernet0/19
!
interface GigabitEthernet0/20
!
interface GigabitEthernet0/21
!
interface GigabitEthernet0/22
!
interface GigabitEthernet0/23
!
interface GigabitEthernet0/24
!
interface GigabitEthernet0/25
!
interface GigabitEthernet0/26
!
interface GigabitEthernet0/27
!
interface GigabitEthernet0/28
!
interface GigabitEthernet0/29
!
interface GigabitEthernet0/30
!
interface GigabitEthernet0/31
!
interface GigabitEthernet0/32
!
interface GigabitEthernet0/33
!
interface GigabitEthernet0/34
!
interface GigabitEthernet0/35
!
interface GigabitEthernet0/36
!
interface GigabitEthernet0/37
!
interface GigabitEthernet0/38
!
interface GigabitEthernet0/39
!
interface GigabitEthernet0/40
switchport mode access
!
interface GigabitEthernet0/41
switchport access vlan 2
switchport mode access
!
interface GigabitEthernet0/42
switchport access vlan 2
switchport mode access
!
interface GigabitEthernet0/43
switchport access vlan 3
switchport mode access
!
interface GigabitEthernet0/44
switchport access vlan 3
switchport mode access
!
interface GigabitEthernet0/45
switchport access vlan 4
switchport mode access
!
interface GigabitEthernet0/46
switchport access vlan 4
switchport mode access
!
interface GigabitEthernet0/47
switchport access vlan 5
switchport mode access
!
interface GigabitEthernet0/48
switchport access vlan 5
switchport mode access
!
interface GigabitEthernet0/49
!
interface GigabitEthernet0/50
!
interface GigabitEthernet0/51
!
interface GigabitEthernet0/52
!
interface Vlan1
ip address dhcp
!
interface Vlan2
ip address dhcp
!
interface Vlan3
ip address dhcp
!
interface Vlan4
ip address dhcp
!
interface Vlan5
ip address dhcp
!
interface Vlan6
no ip address
!
ip http server
ip http secure-server
!
!
!
!
line con 0
exec-timeout 0 0
logging synchronous
line vty 0 4
login
line vty 5 15
login
!
end


Let me know if you see something wrong.

 

Regards,

Bob

Hello,

 

you have 'ip routing' enabled on the switch. This effectively makes the switch a router. No DHCP broadcasts from anywhere will go through the Vlan 1 interface. You need to configure an ip helper address on the Vlan 1 interface, where the IP address is the address of your DHCP server:

 

interface Vlan1
ip address dhcp

--> ip helper-address ip_address_dhcp_server

Hello


@Georg Pauwen wrote:

you have 'ip routing' enabled on the switch. This effectively makes the switch a router. No DHCP broadcasts from anywhere will go through the Vlan 1 interface. 


This is not correct, The switch should still be able to receive dhcp allocation, As such no relay should not be required either


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

@paul driver I did not get it to work with 'ip routing' enabled on the head switch. If you did, can you post your working configs ?

Review Cisco Networking products for a $25 gift card