[ 永遠的UNIX::UNIX技術資料的寶庫 ]   GB | BIG5

首頁 > 系統管理 > FreeBSD > 正文
如何使用IP Alias?
不詳 (2001-04-16 14:21:02)
用 IP Alias 可以讓你收發其他 IP 的訊息 彷佛就像是另插一張網路卡一樣, 
當然, 你所 alias 的 IP 必須是你 localnet 有的. 

首先讀讀 man ifconfig 

ifconfig {interface} {ip_addr_alias} netmask 255.255.255.255 alias 

范例 : (2.1.x/2.2.x) 
ifconfig ed0 140.113.122.1 netmask 255.255.255.255 alias 

范例 : (3.0-CURRENT) 
ifconfig ed0 inet 140.113.122.1 netmask 255.255.255.255 alias 

要去掉 alias : (就是把最改為 -alias) 
ifconfig {interface} {ip_addr_alias} netmask 255.255.255.255 -alias 

要想在開機時就自動設定IP Alias,需要在/etc/rc.conf下加入: 
ifconfig_ed0_alias0="inet xxx.xxx.xxx.xxx netmask 255.255.255.xxx" 
                          ^^^^^^^^^^^^^^^ 
                          這裡是你希望使用的IP地址。 
通過這種方式你可以給一塊網卡設定很多IP地址。 
(http://www.fanqiang.com)
    進入【UNIX論壇

相關文章

======
 

★  樊強制作 歡迎分享  ★