FreeBSD中绑定多IP

vi /etc/rc.conf

以下是我在虚拟机中的一个绑定多IP示例:

 

# Created: Sat Apr 10 17:06:56 2010

# 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.

# — sysinstall generated deltas —

ifconfig_em0=”inet 192.168.245.11 netmask 255.255.255.0″

gateway_enable=”NO”

defaultrouter=”192.168.245.2″

hostname=”192.168.245.11″

ifconfig_em0=”inet 192.168.245.14 netmask 255.255.255.0″

ifconfig_em0_alias0=”inet 192.168.245.15 netmask 255.255.255.0″

ifconfig_em0_alias1=”inet 192.168.245.16 netmask 255.255.255.0″

ifconfig_em0_alias2=”inet 192.168.245.17 netmask 255.255.255.0″

defaultrouter=”192.168.245.2″

hostname=”192.168.245.11″

sshd_enable=”yes”

 

最后执行如下命令,让rc.conf立即生效

# sh /etc/rc

Drop Your Comment