freebsd一块网卡添加多个ip地址
2008-11-05 15:19
351 查看
因业务需要。freebsd服务器在同一网卡下需要添加多个ip地址。登陆到服务器使用ifconfig 命令。 ifconfig {interface} {ip_addr_alias[/b]} netmask 255.255.255.255 alias[/b] 如:# ifconfig rl0 192.168.1.5 netmask 255.255.255.0 alias
# ifconfig
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=8<VLAN_MTU>
inet 192.168.1.3 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
ether 00:e0:4c:8c:59:75
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
要去掉 alias[/b] : (就是把最后改为 -alias[/b])
ifconfig[/b] {interface} {ip_addr_alias[/b]} netmask 255.255.255.255 -alias[/b]
如:# ifconfig rl0 192.168.1.5 netmask 255.255.255.255 -alias
# ifconfig
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=8<VLAN_MTU>
inet 192.168.1.3 netmask 0xffffff00 broadcast 192.168.1.255
ether 00:e0:4c:8c:59:75
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
要想在开机时就自动设定IP Alias[/b],需要在/etc/rc.conf下加入:
ifconfig[/b]_rl0_alias[/b]0="inet xxx.xxx.xxx.xxx netmask 255.255.255.xxx"
^^^ ^^^^^^^^^^^^^^^
网络接口名称 这里是你希望使用的IP地址。
通过这种方式你可以给一块网卡设定很多IP地址。
# ifconfig
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=8<VLAN_MTU>
inet 192.168.1.3 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.1.5 netmask 0xffffff00 broadcast 192.168.1.255
ether 00:e0:4c:8c:59:75
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
要去掉 alias[/b] : (就是把最后改为 -alias[/b])
ifconfig[/b] {interface} {ip_addr_alias[/b]} netmask 255.255.255.255 -alias[/b]
如:# ifconfig rl0 192.168.1.5 netmask 255.255.255.255 -alias
# ifconfig
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=8<VLAN_MTU>
inet 192.168.1.3 netmask 0xffffff00 broadcast 192.168.1.255
ether 00:e0:4c:8c:59:75
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
要想在开机时就自动设定IP Alias[/b],需要在/etc/rc.conf下加入:
ifconfig[/b]_rl0_alias[/b]0="inet xxx.xxx.xxx.xxx netmask 255.255.255.xxx"
^^^ ^^^^^^^^^^^^^^^
网络接口名称 这里是你希望使用的IP地址。
通过这种方式你可以给一块网卡设定很多IP地址。
相关文章推荐
- 老男孩教育每日一题-2017年3月16日: linux网络配置中如何给一块网卡添加多个IP地址
- Linux一块网卡添加多个IP地址
- Linux下一块网卡设置多个IP地址
- Linux系统下一块网卡配置多个Ip地址方法
- FreeBSD下一块网卡绑定多个IP
- 一块网卡配2IP地址
- FreeBSD下一块网卡绑定多个IP
- 如何在Windows7的虚拟机中添加一块虚拟网卡
- 添加网卡子接口ip地址shell脚本
- Linux系统下一块网卡绑定多个Ip地址方法
- 如何给同一块网卡绑定多个IP地址
- FreeBSD实现一块网卡绑定多个IP方法
- Linux系统下一块网卡配置多个ip地址方法
- RHEL7 添加网卡并设置多个IP地址
- 一块网卡绑定多个IP地址(内含Redhat和Ubuntu
- 一块网卡绑定多个IP地址
- 虚拟机如何添加一块新的网卡并开启NAT网络模式
- 一块网卡设置多个IP地址
- LINUX添加一块网卡地址配置及问题
- Linux下一块网卡设置多个IP地址