FreeBSD networking - How to assign or remove fixed IP

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>

ifconfig bce0 inet netmask
route add default

Make changes permanently :
As an example of the above, insert the below parameters into /etc/rc.conf :
ifconfig_bce0="inet netmask"

Remove assigned IP address from network interface
ifconfig <interface name> down delete
ifconfig bce0 down delete

Voilla !!!

No comments: