# how to avoid getting certaiIP-addresses with NetworkManager?

## jody

Hi

Due to a complicated setup of routers and WiFi

dhcp sometimes assigns addresses in the range 192.168.0.xxx.

If i get one of these adresses, i can't connect to the world (i would need a 192.168.1.xxx address)

Before i used NetWorkManager ans NM-Applet, i could blacklist this in /etc/conf.dnet:

```
dhcpcd_wlan0="-X 192.168.77.1 -X 192.168.0.1 -X 192.168.0.105"

```

But this does not seem to work now that i use NetworkManager.

Can anybody help here?

Thank you

  jody

----------

## Hu

Perhaps it would be better to fix your network so that you do not have competing DHCP servers in a single segment.  This is a recipe for trouble, and fixing it at the source is a better choice than asking each individual client to ignore the bogus DHCP server.

----------

## jody

I am afraid i can't change much about the network:

In one lodger's apartment there is the modem, to which a switch in the basement is connected.

This switch is connected to various apartments by cables, including mine.

Finally, i have a wifi point for the network in my apartment.

When i connect my laptop to the wifi emitter by cable, i get a good ip-address.

When i use the wireless, i get a bad address. Interestingly, we also have a windows laptop,

which has no network problems via my wifi.

Since only i seem to have a wireless problem, it would be easiest

if i could force my dhcp client to ignore certain IP-offers.

As i said before, this approach has worked well before i used NetworkManager.

Is the conf.d/net ignored when NetworkManager is running?

If yes, how can i let dhcp client know what i expect?

Thank You

  Jody

----------

## Hu

I do not use NetworkManager.  Is the same address issued to both the working and non-working laptops?  Are you able to configure the wireless access point in any way?  What addresses does it offer over wired and over wireless?

----------

## jody

Freshly booted, 

the wired connection gets 192.168.1.47 

and the wireless gets        192.168.0.105

resolv.conf is set to 

```
# Generated by NetworkManager

nameserver 192.168.1.1

nameserver 192.168.0.1

```

The working laptop gets 192.168.1.52 (with gateway 192.168.1.1)

Concerning the access point, i should be able to configure it over the address 192.168.2.1,

but it seems i can't connect to it...

I know it is neither 192.168.0.1 nor 192.168.1.1, because when i disconnect it from

the outside connection i can't connect to either of these two addresses.

I'll probably have to try to reset it to factory defaults and hope to find it at 192.168.1.1

if i want to configure it.

----------

## Hu

 *jody wrote:*   

> the wired connection gets 192.168.1.47 
> 
> and the wireless gets        192.168.0.105
> 
> The working laptop gets 192.168.1.52 (with gateway 192.168.1.1)

 Weird.  Are you sure that both laptops are associating to the same wireless AP?  Do they agree about the MAC of the AP?

----------

## jody

I haven't gotten around to checking the MAC info for the access points.

(how do i find the MAC address associated to the AP)

More weird:

The above results happened when the ethernet cable was plugged in at boot.

When i boot without the cable, my wlan0 gets a good address: 192.168.1.61 

(which works well - i'm posting this message through wlan0)

Pragmatically, this issue is solved, but i would really like to understand what is going on;

whether it is a problem of my AP, or a problem of NetworkManager or...?!

Thank You 

  Jody

----------

