11da1 DHCP to static IP failure - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Server & Networking > Networking

Networking Network related discussions (including general TCP/IP stuff, routing, etc).

Reply
 
Thread Tools Display Modes
  #1  
Old August 9th, 2012, 21:49
freepara freepara is offline
Junior Member
 
Join Date: Aug 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default DHCP to static IP failure

My experience is similar to another user's post : I installed FreeBSD 9.0 using DHCP, then tried to switch to a static IP address witout success.

In rc.conf I commented out the
Code:
ifconfig_dc0="DHCP"
line and added
Code:
ifconfig_dc0="inet a.b.c.d netmask 255,255,255,0"
and
Code:
defaultrouter="e.f.g.h"
The DNS servers are the same for DHCP and static IP addresses, so resolv.conf was unchanged.

After the changes, pinging the default gateway reults in "Host is down". Using the same cable and a windows machine and the static address and gateway, one can successfully ping the gateway and access the internet. Using the dynamically assigned address in freeBSD, the gateway does respond to pings.

I also used # sysinstallto change to the static address and got no better results.

One additional, possibly irrelevant fact: When I first tried the change to static IP, the gateway was actually down, couldn't be pinged from any machine.

I have used FreeBSD since verion 3.something, and this is the first time I have had such a perplexing problem. I'm hoping for enlightenment.

Thanks.
Reply With Quote
  #2  
Old August 9th, 2012, 22:07
kpa kpa is offline
Giant Locked
 
Join Date: Jul 2010
Location: People's Technocratic Republic of Finland
Posts: 2,007
Thanks: 44
Thanked 466 Times in 396 Posts
Default

The netmask should be written with dots,

Code:
ifconfig_dc0="inet a.b.c.d netmask 255.255.255.0"
You can also write the address in CIDR notation,

Code:
ifconfig_dc0="inet a.b.c.d/24"
Reply With Quote
  #3  
Old August 10th, 2012, 12:39
freepara freepara is offline
Junior Member
 
Join Date: Aug 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default A clarification

kpa said: "The netmask should be written with dots".

It was. The code I posted was just typed in, not pasted, too hastily. In not using CIDR notation, I was just mimicking what sysinstall does when setting up the dc0 interface.

Here's what $ netstat -rn has to say:

Code:
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            10.10.5.1          UGS         0       84    dc0
127.0.0.1          link#4             UH          0       55    lo0
10.10.5.0/24       link#2             U           0        2    dc0
10.10.5.232        link#2             UHS         0        5    lo0
with Internet6 stuff omitted. And here is rc.conf:

Code:
hostname="x.y.z"
ifconfig_dc0="inet 10.10.5.232 netmask 255.255.255.0"
defaultrouter="10.10.5.1"
#ifconfig_dc0="DHCP"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="NO"
powerd_enable="NO"
I hope this clarifies my earlier post. (The set-up given makes the gateway un-pingable, Host is down; enabling DHCP and commenting out the appropriate lines makes the internet reachable.)

Thanks.
Reply With Quote
  #4  
Old August 10th, 2012, 12:51
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,702
Thanks: 47
Thanked 2,022 Times in 1,861 Posts
Default

Ping the IP address of the gateway. Not the hostname.

I'm guessing internet isn't "working" because /etc/resolv.conf doesn't contain any DNS servers.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #5  
Old August 10th, 2012, 21:52
freepara freepara is offline
Junior Member
 
Join Date: Aug 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

SirDice said: "Ping the IP address of the gateway. Not the hostname.
I'm guessing internet isn't "working" because /etc/resolv.conf doesn't contain any DNS servers."

Pinging the IP address (I don't even know its hostname) of the gateway produces "Host is down". It's not down; using DHCP or another computer shows that it is responding to pings properly.

Here is /etc/resolv.conf:

Code:
# Generated by resolvconf
search xxx.yyy
nameserver 10.1.1.60
nameserver 10.1.1.61
The search argument is the appropriate one for my daomain and the nameserver addresses are the same whether DHCP is used or not, I am told. Fearing an incompatibilty between my public IP address and private addresses of the nameservers, I tried google's 8.8.8.8, but the gateway was still "down".

Just as a matter of curiosity: I gathered that the gateway should be pingable even without nameservers, since it is on the same subnet as defined by the netmask 255.255.255.0. Was I incorrect?

Thanks
Reply With Quote
  #6  
Old August 11th, 2012, 10:13
jalla's Avatar
jalla jalla is offline
Member
 
Join Date: Aug 2009
Location: Bergen, Norway
Posts: 334
Thanks: 11
Thanked 67 Times in 58 Posts
Default

Quote:
Originally Posted by freepara View Post
Just as a matter of curiosity: I gathered that the gateway should be pingable even without nameservers, since it is on the same subnet as defined by the netmask 255.255.255.0. Was I incorrect?

Thanks
Are you sure it's on the same subnet? What subnet mask does the gateway have?
(Or IOW, what mask do you get when you use DHCP?)
__________________
Practical latin
Amicule, deliciae, num is sum qui mentiar tibi?
But dear, could I ever lie to you?
Reply With Quote
  #7  
Old August 11th, 2012, 11:43
freepara freepara is offline
Junior Member
 
Join Date: Aug 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

When I use DHCP, I get a private IP address for the gateway, 10.1.10.1, and my compter's private address is 10.1.10.14, and all is well. When I try to use my public address x.y.z.232, my netmask is 255.255.255.0 and the gateway is x.y.z.1 (x, y, and z being in the range 1-254). I don't know what the netmask of x.y.z.1 is, nor do I know that 10.1.10.1 maps to x.y.x.1. I do know that 10.1.10.1 doesn't work as a gateway for x.y.z.232 (nor, I guess, should it.)
Reply With Quote
  #8  
Old August 13th, 2012, 11:25
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,702
Thanks: 47
Thanked 2,022 Times in 1,861 Posts
Default

There's a router in front of your network that's already doing NAT. This means you can't use the external IP address internally.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #9  
Old August 14th, 2012, 19:22
freepara freepara is offline
Junior Member
 
Join Date: Aug 2012
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The systems guy was just in and a quick reconfiguration of the port made all well. Not a FreeBSD problem at all, though it took a lot of trying to get to the point where they listened to me seriously.

The base problem was that I was away for two months, during which time a) the motherboard on the computer in question failed, and b) they made some changes to port configuations in my office suite. If the mobo hadn't failed, it would have been clear that that their reconfiguration was at fault. With the two happenning in tandem, it was unclear where the problem was.

My most profound thanks to SirDice, jalla, and kpa for taking teh time and having the patience to help out.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] Losing Static IP erohal Networking 5 February 17th, 2012 18:54
FreeBSD as a DHCP Server or DHCP Relay swavijay Installing & Upgrading 5 February 15th, 2012 17:41
[Solved] ppp nat static/dynamic Junaid Networking 11 May 11th, 2011 09:59
How to configure DHCP server, Static NAT with 5 IPs (not just one) and gateway? jbarton Networking 3 February 23rd, 2010 18:45
Freebsd dhcp client from a Windows dhcp server Dillweed Networking 12 September 10th, 2009 01:15


All times are GMT +1. The time now is 22:47.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0