Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a FreeBSD machine running on a virtual machine. I am using SUN Virtual Box. I need to set static IP address to this machine. So that I can access this machine. Is there anyway to do this ?

share|improve this question

migrated from stackoverflow.com Jun 12 '10 at 10:42

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers

up vote 13 down vote accepted

in /etc/rc.conf:

ifconfig_em0="inet 192.168.0.254 netmask 255.255.255.0"
defaultrouter="192.168.0.1"
192.168.0.254 -- the machine IP, 192.168.0.1 -- gateway
These settings in rc.conf are looked up in the boot process.
If you'd like to set ip manually, run:
ifconfig em0 inet 192.168.0.254 netmask 255.255.255.0
route delete default; route add default 192.168.0.1

share|improve this answer
add comment

Another way to do the same thing:

  • run "sysinstall" as root
  • "configure"
  • "networking"
  • "interfaces"
  • Now choose you interface and configure it.
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.