# DHCP problem...

## Bumppo

I'm having a problem with the wired ethernet on my Mac mini, on which I recently installed Gentoo.

I'm using the DHCP client dhcpcd, and it appears to work correctly, saying "Address received".  But while normally it prints an address to the screen after that, no address is printed, and ping commands fail because of an unknown host.  What could be causing this?

Thanks for any help.

----------

## UberLord

Several dhcpcd problems specific to ppc have been fixed recently - try dhcpcd-2.0.8 which went into portage a few hours ago.

----------

## Bumppo

Well, now it receives an address but still nothing on the ping...

----------

## UberLord

Care to post the results of this?

```

killall dhcpcd

dhcpcd eth0

ifconfig eth0

route -n

```

Replace eth0 with your interface name - thanks

----------

## Bumppo

```
ifconfig eth0

eth0       Link encap:Ethernet   HWaddr 00:11:24:76:D9:C6

              UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

              RX packets:117230 errors:0 dropped:0 overruns:0 frame:0

              TX packets:230562 errors:0 dropped:0 overruns:0 carrier:0

              collisions:0 txqueuelen:1000

              RX bytes:50202765 (47.8 Mb)  TX bytes:54673096 (52.1 Mb)

              Interrupt:41 Base address:0xc400
```

```
route -n

Kernel IP routing table

Destination              Gateway                  Genmask                 Flags  Metric  Ref       Use  Iface

127.0.0.0                127.0.0.1                255.0.0.0               UG     0       0         0    lo
```

----------

## UberLord

If you're using dhcpcd-2.0.8 you can do this to get more info

```
dhcpcd -d eth0
```

----------

## Bumppo

```
dhcpcd -d eth0

Info, MAC address = 00:11:24:76:d9:c6

Debug, broadcasting DHCP_REQUEST for 192.168.2.2

Debug, broadcastAddr option is missing in DHCP server response.  Assuming 192.168.2.255

Debug, dhcpIpaddrLeaseTime=4294967295 in DHCP server response.

Debug, dhcpT1value is missing in DHCP server response.  Assuming 2147483647 sec

Debug, dhcpT2value is missing in DHCP server response.  Assuming 3758096383 sec

Debug, DHCP_ACK received from  (192.168.2.1)

Debug, broadcasting ARPOP_REQUEST for 192.168.2.2

Info, verified 192.168.2.2 address is not in use

Info, your IP address = 192.168.2.2

Debug, orig hostname = localhost

Debug, about to exec "/etc/dhcpc/dhcpcd.exe /var/lib/dhcpc/dhcpcd-eth0.info up"
```

----------

## UberLord

Well, that shows it worked - I cannot believe that ifconfig eth0 reports no configuration after that.

----------

## Bumppo

I know, I find this quite irritating myself.

----------

## runningwithscissors

Strange that ifconfig does not report an address.

Does ping work after it acquires an address? If not, have you tried setting up the routes manually?

----------

## Bumppo

I was thinking of that myself (I've been working for three straight days on this, my company got a whole bunch of Mac minis to use...with Linux).

But yeah, I tried to add it myself, and got an error "SIOCADDRT: Network is unreachable".  What could that mean?

----------

## runningwithscissors

 *Bumppo wrote:*   

> I was thinking of that myself (I've been working for three straight days on this, my company got a whole bunch of Mac minis to use...with Linux).
> 
> But yeah, I tried to add it myself, and got an error "SIOCADDRT: Network is unreachable".  What could that mean?

 

That error usually occurs if the route cannot be added. Usually it happens when you are trying to use an address that is not directly connected to your machine.

----------

## UberLord

You could always try another dhcp client - there's another 3 to try!

----------

## Bumppo

 *runningwithscissors wrote:*   

>  *Bumppo wrote:*   I was thinking of that myself (I've been working for three straight days on this, my company got a whole bunch of Mac minis to use...with Linux).
> 
> But yeah, I tried to add it myself, and got an error "SIOCADDRT: Network is unreachable".  What could that mean? 
> 
> That error usually occurs if the route cannot be added. Usually it happens when you are trying to use an address that is not directly connected to your machine.

 

Hmm...it's definitely directly connected, unless a surge protector counts as interference.  And it works with the install CD, and my x86 Gentoo machine.  Strange stuff.

Yeah, I guess I will try another.

----------

## Bumppo

Yeah, pump worked fine.  Must be some kind of dhcpcd Power-PC bug.

----------

## UberLord

 *Bumppo wrote:*   

> Yeah, pump worked fine.  Must be some kind of dhcpcd Power-PC bug.

 

Could you humour me and see if dhcpcd-2.0.3 works?

Also, could you post your CFLAGS - thanks

----------

## turtles

Just did a fresh install and I get the error "network unreachable" after ping.

And 

```
dhcpcd -d eth0
```

 returns:

```
**** dhcpcd:alredy running

**** dhcpcd: if not then delete /var/run/dhcpcd-eth0.pid file
```

A

```

ifconfig eth0
```

returns

```
eth0    Link encap:Ethernet HWaddr 00:05:02:4b:28:BD

                    UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1

                    RX packets:365 errors:177 dropped:177 overruns:0 frame:177

                    TX packets:1601 errors:0 dropped:0 overruns:0 carrier:0

                    collisions:0 txquelen:1000

                    Rx bytes:210370 (205.4 kb) TX bytes:285452 (278.7 kb)

                    Interrupt:42 Base address:0X0000
```

May be type'os because I copyed by hand (no ssh).

I usualy use esearch to compare versions but I dont have installed yet, If you need to know what version let me know an alterneate comand to tell.

I am running latest everything stable gcc 4.1.1, 2.6.16-gentoo-r9, ppc G3 imac. I compiled bmac into kernel not as module. Emerge info is here

thanks in advance!

----------

## turtles

Killed the pid and re ran 

```
dhcpcd -d eth0
```

```
info, MAC address + 00:05:02:4b:28:bd

debug, broadcasting DHCP_REQUEST for 192.168.0.6

debug, broadcastAddr is missing in DHCP server responce. Assuming 192.168.255

debug, dhcpIPaddrLeaseTime=4294967295 in DHCP server responce.

debug, dhcpT1value is missing in DHCP server responce. Assuming 2147483647 sec

debug, dhcpT2value is missing in DHCP server responce. Assuming 3758096383 sec

debug, DHCP_ACK recieved from (192.168.0.1)

debug broadcasting ARPOP_REQUEST fot 192.168.0.6

error, arpCheck: recvfrom: Network is down

error, requested 192.168.0.6 address in use

debug, broadcasting DHCP_DECLINE

debug, broadcasting DHCP_DISCOVER

debug, broadcastAddr is missing in DHCP server responce. Assuming 192.168.255

debug, dhcpIPaddrLeaseTime=4294967295 in DHCP server responce.

debug, dhcpT1value is missing in DHCP server responce. Assuming 2147483647 sec

debug, dhcpT2value is missing in DHCP server responce. Assuming 3758096383 sec

debug DHCP_OFFER recieved from (192.168.0.1)

debug broadcasting ARPOP_REQUEST fot 192.168.0.6

debug, dhcpIPaddrLeaseTime=4294967295 in DHCP server responce.

debug, dhcpT1value is missing in DHCP server responce. Assuming 2147483647 sec

debug, dhcpT2value is missing in DHCP server responce. Assuming 3758096383 sec

debug, DHCP_ACK recieved from (192.168.0.1)

debug broadcasting ARPOP_REQUEST fot 192.168.0.6

info, verified 192.168.0.6 address is not in use

error, dhcpConfig: ioctl SIOCADDRT: File exists

info, your IP address = 192.168.0.6

debug, orig hostname = accordian
```

Note: in /etc/conf.d/net I did have 

```
config_eth0=( "dhcp" )
```

 after install noticed the network not working then I removed it and rebooted without it before my first post. I did not assign a static IP, It did find its old ip address from the router.

----------

## UberLord

Please test with dhcpcd-2.0.8

----------

## turtles

```
livecd / # esearch dhcpcd

[ Results for search key : dhcpcd ]

[ Applications found : 1 ]

*  net-misc/dhcpcd

      Latest version available: 2.0.5

      Latest version installed: 2.0.5

      Size of downloaded files: 365 kB

      Homepage:    http://developer.berlios.de/projects/dhcpcd/

      Description: A DHCP client only

      License:     GPL-2

```

I just --synced ther is no 2.0.8 version, do I have to do somthing special to emerge it?

----------

## think4urs11

 *turtles wrote:*   

> I just --synced ther is no 2.0.8 version, do I have to do somthing special to emerge it?

 

```
echo net-misc/dhcpcd >> /etc/portage/package.keywords

emerge dhcpcd -pv
```

----------

## turtles

Thanks Think4UrS11, I was able to 

```
 emerge -u dhcpcd
```

.

I rebooted and it improved, it sohwed that it got it's ip address.

But ping still returns network is unreachable.

Note I typed the code output here (no ssh) so  no caps and type'os are probably made by me.

running dhcpcd -d eth0

I get 

```
**** dhcpcd alredy running 

***** dhcpcd: If not then delete /var/run/dhcpcd-eth0.pd file
```

So I did the running the command gets

```
info mac address + 00:05:02:4b:28:bd

debug, broadcasting dhcp_request for 192.168.0.6

debug, broadcastaddr option is missing in dhcp server responce. assuming 192.168.0.255

debug, dhcpipaddressleasetime=4294967295 in dhcp server responce

debug, dhcpT1value is missing in DHCP server responce. Assuming 2147483647 sec 

debug, dhcpT2value is missing in DHCP server responce. Assuming 3758096383 sec 

debug, DHCP_ACK recieved from (192.168.0.1) 

debug broadcasting ARPOP_REQUEST fot 192.168.0.6 

debug, arpop_reply received from 192.168.0.6 for 255.255.255.255

debug, target hardware address mismatch: 00.09.5b.2b.79.f8 recieved, 00.05.02.4b.28.bd expected

error, requested 192.168.0.6 address is in use

debug, broadcasting DHCP_DECLINE 

debug, broadcasting DHCP_DISCOVER 

error, network is down

```

I had reserved 192.168.0.6 for accordian since it will be a web server.

I removed the reservation and reset the router to eliminate that as an issue.

I killed dhcpcd again and re ran it with the -d

```

info mac address + 00:05:02:4b:28:bd

debug, broadcasting dhcp_request for 192.168.0.6

debug, broadcastaddr option is missing in dhcp server responce. assuming 192.168.0.255

debug, dhcpipaddressleasetime=4294967295 in dhcp server responce

debug, dhcpT1value is missing in DHCP server responce. Assuming 2147483647 sec 

debug, dhcpT2value is missing in DHCP server responce. Assuming 3758096383 sec 

debug, DHCP_ACK recieved from (192.168.0.1) 

debug broadcasting ARPOP_REQUEST fot 192.168.0.6 

info, verified 192.168.0.6 address is not in use 

info, your IP address + 192.168.0.6

debug, orig hostname = accordian

debug, about to exec "etc/dhcp/dhcpcd.exe /var/lib/dhcp/dhcpcd-eth0.info up"

```

----------

## think4urs11

please provide output of

```
ifconfig -a

netstat -rn

ping -c1 127.0.0.1

ping -c1 <ip you got from your dhcp server>

traceroute -n 66.249.85.99  (thats one of google.coms servers)
```

----------

## turtles

```
eth0 link encap:ethernet hwaddr 00:05:02:4b:28:bd

UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1

RX packets:3817 errors:1522 dropped:1522 overruns:0 frame:1522

TX packets:16735 errors:0 dropped:0 overruns:0 carrier:0

Collisions:0 txqueuelen:1000

RX bytes:2206022 (2.1 MB) TX bytes:4234694 (4.0 mb)

interrupt:42 Base address:0x0000

lo Link encap:local loopback

inetaddr:127.0.0.1 MASK:255.0.0.0

UP LOOPBACK RUNNING MTU:16436 Metric:1

UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1

RX packets:0 errors:0 dropped:0 overruns:0 frame:0

TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

Collisions:0 txqueuelen:0

RX bytes:0 (0 b) TX bytes:0 (0 b)

```

netstat -rn

```
Kernel IP routing table

Destination      gateway       genmask          flags        mss window      irrt Iface

127.0.0.0          127.0.0.1      255.0.0.0         UG            0 0                  0 lo

```

ping -c1 127.0.0.1

```
 PING 127.0.01 (127.0.0.1) 56(84) bytes of data

64 bytes from 127.0.0.1: icmp_seq=1 ttl=65 time=0.189 ms

--- 127.0.0.1 ping statistics ---

1 packets transmitted, 1 received, 0% packet loss, time 0ms

rtt min/avg/man/mdev = 0.189/0.189.0/0.189/0.00 ms

```

ping -c1 192.168.0.6

```
 connect: Network is unreachable
```

traceroute command not found

(I could emerge it from the live cd if it would help)

NOTE: This is an extermely minimal G3 imac, "headless server" . See the emerge info link posted above for more info.

thanks for the quick responce! and all your sugestions are great! Thats what I love about gentoo.

----------

## think4urs11

uhm..... getting out of ideas here; missing access rights or similar maybe?

what gives

```
la -la /var/lib/dhcp/

ls -la /var/run/dhcp*

ls -la /etc/dhcp/
```

----------

## turtles

ls -la /var/lib/dhcp/

```
ls: /var/lib/dhcp/: No such file or directory
```

ls -la /var/run/dhcpcd-eth0.pid

```
-rw-r--r-- 1 root root 5 july 19 12:23 /var/run/dhcpcd-eth0.pid
```

ls -la /etc/dhcp

```
/etc/dhcp: No such file or directory
```

Hmmm let me guess thats not right?

also tried ls -la /var/lib/dhcpc

```
-rw------- 1 root root 136 july 19 12:26 dhcpcd-eth0.cache

-rw-r--r-- 1 root root 136 july 19 12:26 dhcpcd-eth0.info

-rw-r--r-- 1 root root 136 july 19 12:26 dhcpcd-eth0.info.old
```

Note /var and /usr is a seperate partiton on the imac G3 ppc the emerge --info etc fstab and more are here .

----------

## UberLord

 *Think4UrS11 wrote:*   

> uhm..... getting out of ideas here; missing access rights or similar maybe?
> 
> what gives
> 
> ```
> ...

 

That's used by net-misc/dhcp, not net-misc/dhcpcd

----------

## UberLord

 *turtles wrote:*   

> Thanks Think4UrS11, I was able to 
> 
> ```
>  emerge -u dhcpcd
> ```
> ...

 

Try this

dhcpcd -d -a eth0

If that fails, try dhcpcd-2.0.3

----------

## turtles

```
dhcpcd -d -a eth0 
```

got the same results as before

rebooted from live cd chrooted again and

```
emerge -v =net-misc/dhcpcd-2.0.3

```

Worked!

Thank you both, I am fresh up on my portage skills, and I could not have paid for better support!

Should I mask??

I will do some research on how to mask packages and mask the other ones so it doesnt pull it back in when I update world??

If you want me to do some patch testing on ppc or anything drop me a pm.

cheers

t

----------

