cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
970
Views
0
Helpful
8
Replies

PC gets gateway from neighbouring subnet

lupin4egg
Level 1
Level 1

Hello everyone!

 

Actually this is a very strange problem. First I set up a few static IP mapping using FTP. After saving the configurations and rebooting the devices, everything suddenly stopped working correctly.

 

Let me explain. I am using GNS3 and Cisco c7200. OS: Ubuntu 22.10.  FTP server works through QEMU(ftp server on Ubuntu server 22.10). So, after rebooting the devices, when "ip dhcp" is entered into the PC, the wrong gateway is displayed, more precisely the gateway of the neighboring interface, in my case f0/0. For example, on subnet 10.17.2.0 computers have IP 10.17.2.2 and 10.17.2.3 (2 pc in this subnet)

 

In the dhcp pool, I specify default-router 10.17.2.1 (f0/1 on this subnet 10.17.2.1). As soon as the PC has received the data, instead of the expected gateway 10.17.2.1, I see 10.17.1.1. Only here 10.17.1.1 is generally on a different interface. It is important to note that if the PC(ip + client-identifier) is not statically mapped via ftp, then the correct gateway is displayed and everything works.

 

and even if I connect a new subnet 10.17.3.0, where the computers will have 10.17.3.2 and so on (10.17.3.1 interface on the router), then the gateway on the computers is still 10.17.1.1

 

if you enter "show ip" into the computer, then the DHCP-SERVER line displays the desired gateway, and the GATEWAY line displays the gateway of another subnet.

 

What is the problem, please help!

sorry if the labels do not quite fit my question.  I'm still not fully accustomed to this community

1 Accepted Solution

Accepted Solutions

The problem has been solved. 

Solution: you need to create a new pool with a new file for static bindings. I.e. for network 10.17.1.0 file will include only ips for this subnet. Then static bindings 10.17.2.0 file will include only ips for this subnet. Generally, you need to create a new pool and file for each subnet. thanks all

View solution in original post

8 Replies 8

balaji.bandi
Hall of Fame
Hall of Fame

is this IP coming from DHCP Server?

check on each pool what gateway is configured. it looks to me you copied all DHCP config to another pool not change the gateway 

default-router xxxxxxx (each subnet required their own gateway, if you have SVI for each vlan)

 

BB

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

How to Ask The Cisco Community for Help

no no. I checked all entries very carefully before adding them to the pool. there can be no input errors. and usually I don't copy the configurations, but write it myself.

router configurations. maybe it helps you: https://pastebin.com/5iPudAEw

important:  if the PC(ip + client-identifier) is not statically mapped via ftp, then the correct gateway is displayed and everything works.

Zanthra
Level 1
Level 1

If you are handing out 10.17 addresses as per the mapping database, the switch has no DHCP pool default route configuration for the static maps under ip dhcp pool ab .

ok, i what should I do?

Zanthra
Level 1
Level 1

Just to clarify with some questions. Your configuration lists the DHCP pools as 10.18 networks, but you talk about 10.17 networks in your question. Are these correct? Does the switch have another interface not mentioned in that config that is on the 10.17 network? Are you intending to distribute DHCP addresses from static mappings that are not in the same subnet as the switch interfaces they are connected to?

PS: Looking it over again, and thinking about it, I think it's possible the pool IP addresses in the switch config were meant to be 10.17 networks, not 10.18. With static mappings to the 10.17.2 network, the switch provides the statically mapped IP address, but has no default gateway configured for the 10.17.2 netowrk, so it inherits the switche's own IP default gateway, which is 10.17.1.1 (I can only assume as that is not shown in the config you posted).

When clients get a dynamic address, the address is provided in the 10.18.2 range, and the default-router is configured for that pool as the switch IP address of 10.18.2.1, which allows it to forward traffic to the other networks.

If this is the problem, the easiest fix should be to change the static mappings in your mappings file to 10.18.2.x instead of 10..17.2.x.

No. I attached my real configs. 10.17 network was mentioned only for example. But problem exists in 10.17, 10.18, 10.19 and so on.

Zanthra
Level 1
Level 1

But you are using the 10.17 network as that is the IP address of the FTP server in "ip dhcp database ftp://...@10.17.1.3/ftp_dir/router5"?

If the computers are actually getting addresses in 10.18 networks, are the computers actually recieving 10.18.1.1 as the default gateway, regardless of the 10.18 subnet they are in?

The problem has been solved. 

Solution: you need to create a new pool with a new file for static bindings. I.e. for network 10.17.1.0 file will include only ips for this subnet. Then static bindings 10.17.2.0 file will include only ips for this subnet. Generally, you need to create a new pool and file for each subnet. thanks all

Review Cisco Networking for a $25 gift card