To configure a static IP address on FreeBSD, you will need to perform the following steps:
/etc/rc.conf
, and add the following lines, replacing <interface>
with the name of your network interface and <static IP address>
, <netmask>
, and <default gateway>
with the appropriate values for your network:ifconfig_<interface>="inet <static IP address> netmask <netmask>" defaultrouter="<default gateway>"
Save the changes to the configuration file and exit the text editor.
Restart the network service to apply the changes:
service netif restart
ifconfig
command:ifconfig <interface>
Alternatively, you can use the ip
command to view the network configuration:
ip addr show <interface>