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 ?

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

arrow
arrow
    文章標籤
    freebsd static ip
    全站熱搜
    創作者介紹
    創作者 Frank 的頭像
    Frank

    經驗交流分享與備忘

    Frank 發表在 痞客邦 留言(0) 人氣()