# dhcpcd get the "wrong" ip

## Hexorg

ah! I made it! *happy* intalled gentoo and compiled my own kernel  :Smile:  Thanks everyone here who already helped me  :Smile: 

but now I have a trouble with dhcpcd - it sets me up with the wrong IP.... I think it's the settings error, because livecd sets me up with 192.168.2.3 (i'm behind my router), windows sets me up with the same IP, but newly installed gentoo gave me something of the sort - 169.135.XXX.XXX (don't remember exactly). and nothing internet-ralated (ping -c3 www.google.com) doesn't work.

i've tried to 

```
dhcpcd -k eth0

dhcpcd eth0
```

first it started broadcasting for a lease, then timed out, and used the last lease IP, it also said something about using IPv4LL:169.135.XXX.XXX

restarting the router didn't help.

what can be causing it?

----------

## think4urs11

wrong nic module in your kernel probably

----------

## Hexorg

mmm I don't think so... 

lspci said i need realtek rtl-8169 module. LiveCD lsmod said r8169 module was loaded, and i just checked, if i unload r8169 from my kernel - eth0 disappears, if i load it - it appears, but dhcpcd still gets the wrong address

----------

## albright

Does your network work if you manually assign

ip address etc?

----------

## Hu

Your DHCP client assigned a link local address, because no DHCP server provided an acceptable answer in the timeout period.  Possible problems include that your DHCP server is broken, and ignores requests from dhcpcd; that your DHCP server is very slow, and dhcpcd is not waiting long enough; your DHCP server is broken, and provides a response that dhcpcd considers invalid; your DHCP server has chosen not to issue you an address.

To be clear, when you boot with the LiveCD, you get a valid IP address, but when you boot with the installed system on the same hardware, you get a link local address, correct?  That would tend to implicate an incompatibility between the dhcpcd in the installed system and your router.  A packet capture may tell us more.

----------

## 01allein

Did you emerge dhcpcd?

Did you set up /etc/conf.d/...........

----------

## Hexorg

albrigh, no, manual address does nothing.

Hu, DHCP server is my router, and it should work just fine (i just went in and made sure it wasnt faulty). And yes, your understanding is clear. However, if I put 'noipv4ll' in /etc/dhcpcd.conf the dhcpcd just times out and that's it.

01allein, yes, and yes

----------

## Hexorg

my usb wasn't working either, and online i found out that same reason can affect the connections - i get a nommu_map_single errors.

well, that's not a networking question now. I'll see if i can get online after i fix that problem. Thank you everyone.

----------

## Hu

Assuming that your manual configuration specified an address that otherwise should work, that suggests your network card is not able to pass traffic when using the installed kernel.  Failure to DMA could cause this.  If so, the problem should go away when you include support for the relevant iommu.

When I said your DHCP server could be broken, I meant that it could be misconfigured or behaving in a manner inconsistent with applicable standards and practices, not that it had experienced hardware failure.  It is not uncommon for some types of software to be inconsistent with standards in a manner that breaks Linux, but that the software works just well enough with the particular way that Windows behaves that most users believe their software is correct.

----------

## Hexorg

yea, I understood you about a broken DHCP, and when i added mem=2k to the kernel - it all worked. no matter what iommu I try to add though - i still get that error for some reason... well i have a discussion in kernel branch about that.

Thank you.

----------

