Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

1 Answer

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:

ifconfig_INTERFACE_NAME="inet IP_ADDRESS netmask NETMASK"

for example:

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

Your Answer

 
discard

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.