16 February 2007

Set a static IP/DHCP in FreeBSD

In /etc/rc.conf, change
ifconfig_<network_adapter>="DHCP"
to
ifconfig_<network_adapter>="inet xxx.xxx.xxx.xxx netmask 255.255.255.0"
where xxx.xxx.xxx.xxx is the static IP address to use, and <network_adapter> your network adapter (doh!), e.g. eth0.

Don't forget to add a line like
defaultrouter="10.0.0.1"
to the same file ...

No comments: