Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have

Comcast cable <====> modem <===> router <===> freebsd server

My freebsd server is connected to wireless router via a network cable.

What I want to do is, to have a static ip for the server.

How can I do it?

share|improve this question
up vote 3 down vote accepted

You can set static IP address in FreeBSD in /etc/rc.conf file. First you need to know what is name of your network interface that you want to configure. Use ifconfig to list all network interfaces, when you find it add following line to /etc/rc.conf:


for example:

ifconfig_dc0="inet netmask"
share|improve this answer
And default gateway in /etc/rc.conf: defaultrouter="" – Alpacino Sep 12 '11 at 10:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.