常常我们有需要一个网卡像windows一样设置多个IP。
下面我们看看在ubuntu下怎么样做.
我们先打开网络接口的文件sudo vi /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface auto eth0
iface eth0 inet static
照上边eth0添加eth0:0
auto eth0:0
iface eth0:0 inet static
name Ethernet
重启服务
sudo /etc/init.d/networking restart
测试新的ip地址是否生效
ping 202.205.XXX.XX
ping 202.205.XXX.XX
==============以上为添加同一网段内的IP地址=================
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 举报,一经查实,本站将立刻删除。
文章由极客之音整理,本文链接:https://www.bmabk.com/index.php/post/160559.html