FreeBSD > How to change IP address or setup new ip address to existing interface

1) Use ifconfig command as follows:
ifconfig interface inet IP

Example(s):
ifconfig lnc0 inet 202.54.1.22

Note lnc0 is Ethernet interface name can be Obtained using ifconfig -a command.

2) To setup up ip permanently open file /etc/rc.conf ; add/modify network entries:
vi /etc/rc.conf

And setup values as follows:
hostname="fbsdx.test.com"
ifconfig_lnc0="inet 192.168.0.6 netmask 255.255.255.0"

Note ifconfig_lnc0 is Ethernet interface name can be Obtained using ifconfig -a command.

3) Again re-run /etc/netstart script.

Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!

{ 3 comments… read them below or add one }

1 Anonymous 09.05.05 at 7:25 pm

Thanks for this tip. It was very helpful

2 Hyip 07.19.08 at 9:25 am

Could you please set up an .exe file to do the above procedure
I think making a .exe file with the above commands will make the job easier for repeatedly changing ip addresses

3 Claus Larsen 12.16.08 at 1:08 pm

An exe file, do you have any idea about what you are saying, exe files is a windows thing.

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post: FreeBSD > which directories (PATHs) used to load device drivers (modules)?

Next post: Where is color of ls command defined?