12 March, 2013

Manually assign (add) fixed (static) IP on FreeBSD


Manually assign/add fixed/static IP on FreeBSD:
 
ifconfig em0 inet  netmask 
route add default 
/etc/netstart

e.g.

ifconfig em0 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_em0="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  down delete
e.g.

ifconfig em0 down delete

No comments: