分类: BSD
2008-04-27 13:58:57
FreeBSD下修改ip地址及多IP地址捆定
Freebsd# more /etc/rc.conf
# -- sysinstall generated deltas -- # Thu Oct 12 09:37:56 2006
# Created: Thu Oct 12 09:37:56 2006
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
defaultrouter="10.0.0.1"
hostname="Freebsd.rhel5.com"
ifconfig_lnc0="inet 10.0.0.123 netmask 255.255.255.0"
keymap="us.iso"
linux_enable="YES"
sshd_enable="YES"
Freebsd#
这种方法,信息永久保留,但是修改完需要重启机器。
如果要设置多IP地址可用别名方式作修改如下
ifconfig_lnc0="inet 10.0.0.199 netmask 255.255.255.0"
改为
ifconfig_lnc0_alias0="inet 10.0.0.198 netmask 255.255.255.0"
ifconfig_lnc0_alias1="inet 10.0.0.197 netmask 255.255.255.0"