# dhcp problem: getting a gentoo default IP

## irony

I'm having a problem with dhcp.

It's been working fine for the last couple months, but all of a sudden, today, I found I couldn't ssh into my computer.

I poke around, I run /sbin/ifconfig, and find the problem.

It has inet as 192.168.2.4, bcast as 192.168.2.255

It still works, mostly, I can get out of the box, but not into it.  I recognize these IP's as similar to the default ones in the config files.

I checked /etc/init.d/eth0 and /etc/conf.d/net, and neither of them have any explicit reference to that.  /etc/hosts and /etc/hostname are both fine, and dhcp cache has mostly correct information, except for the inet and bcast.

I have no idea what's going wrong - I've called my ISP, but it's a friday night, so I'm not expecting much from their end, and the specific nature of the problem indicates to me that it's probably internal.

Any help is greatly appreciated.  Thanks!

----------

## pjp

How did you have your IP configured previously?  DHCP, static, what set it?

----------

## px

how are you connected to internet, these ip seems to be local and not the one your ISP could give you. 

for your ssh problem, did you have merge openssh, made the keys and rc-update it, I know it's a fool question but I can't know what you could have done

----------

## irony

I had it configured exactly as it is now.  That's the strange thing.  Nothing has changed except for a shutdown and reboot.  I haven't reconfigured anything, haven't merged anything, nada.

I'm connected to the internet - I'm using this computer to write this post.

The ssh problem was a symptom of the larger problem, I think.

Thanks, tho!

----------

## irony

I backed up the /etc/conf.d/net file and then removed any reference to 192.168.* from it, commented or no, as I believe it uses some of the commented values as defaults.  Same problem.

I may have some other insight - the Mask setting comes back from /sbin/ifconfig as 255.255.255.0, which isn't what it was.  That's only difference I can find.

Thanks again.

----------

## pjp

 *irony wrote:*   

> I had it configured exactly as it is now.

 Which is how?  What did your system do before (when it worked) to get/set an IP?  Was it static, or via DHCP?  Did you configure the conf.d/net file, or use ifconfig to set it?  What is in your /etc/conf.d/net file?

----------

## irony

 *kanuslupus wrote:*   

>  *irony wrote:*   I had it configured exactly as it is now. Which is how?  What did your system do before (when it worked) to get/set an IP?  Was it static, or via DHCP?  Did you configure the conf.d/net file, or use ifconfig to set it?  What is in your /etc/conf.d/net file?

 

It used DHCP.

I configured the /etc/conf.d/net file to say iface_eth0="dhcp" and that is all that is in my /etc/conf.d/net file.

I've dug out a laptop running gentoo that was also using dhcp with no problems previously, and it has the same problem, so I'm beginning to suspect the problem is rooted not in my configuration or even my computer.

Thanks.

----------

## pjp

That is odd.  You aren't using a router, are you?  I've never heard of ISPs issuing a 192 address before.  

When you find out, let us know what the problem was.

----------

## irony

After wrangling with my ISP for the last couple days, I finally convinced them that no, the problem was not on my end.  I had to pull out an old laptop running gentoo which had the same problem even though it hadn't been on the network in six months.

Turns out someone on my subnet was running a DHCP server, either intentionally or accidentally, which was what my gentoo box was using to pick up DHCP information, instead of the server it should have been using.

Thanks for all the help, though.

----------

