FreeBSD networking – How to assign or remove fixed IP

bsd-daemon-logo


Previously, we have talk about how to assigh dynamic IP to an interface on Freebsd. This post is about how to assign fixed or static IP to an interface on Freebsd. Below are the steps :



Manually assign fixed IP :

ifconfig bce0 inet <IP address> netmask <subnet mask>

route add default <gateway IP address>

/etc/netstart


e.g.

ifconfig bce0 inet 192.168.0.10 netmask 255.255.255.0

route add default 192.168.0.1

/etc/netstart


Make changes permanently :

As an example of the above, insert the below parameters into /etc/rc.conf :

ifconfig_bce0="inet 192.168.0.10 netmask 255.255.255.0"
defaultrouter="192.168.0.1"
hostname="hostname.domain.com"


Remove assigned IP address from network interface

ifconfig <interface name> down delete

e.g.

ifconfig bce0 down delete


Voilla !!!

More post - related

Please sponsor my coffee if you find my posts worth reading, thanks!

One Trackback

  1. [...] How to assign or remove fixed IP [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*
-->
Improve the web with Nofollow Reciprocity.