linux – 使用“ip”命令在CentOSRHEL 6中重新启动时保留IP地址别名

linux – 使用“ip”命令在CentOSRHEL 6中重新启动时保留IP地址别名,第1张

概述我总是使用ifcfg-eth0:1别名文件来创建其他地址.但是,在 recent rhel documentation,它指出: As the ip command of the iproute package now supports assigning multiple address to the same interface it is no longer necessary to use 我总是使用ifcfg-eth0:1别名文件来创建其他地址.但是,在 recent rhel documentation,它指出:

As the ip command of the iproute package Now supports assigning multiple address to the same interface it is no longer necessary to use this method of binding multiple addresses to the same interface.

此外,本网站上的许多答案和评论都提到ifconfig已被弃用,而且应该使用“ip”.我很好地使用它进行实时更改,但是如何在不使用别名文件的情况下在重新启动后保留更改?

解决方法 将它们放在/ etc / sysconfig / network-scripts / ifcfg-eth0中,后跟2或3等,例如:
IPADDR2=192.0.2.48NETMASK2=255.255.255.0IPADDR3=192.0.2.49NETMASK3=255.255.255.0

不幸的是,这似乎没有文档记录(或者我现在无法找到它;看起来红帽再次重新安排了他们的网站).

总结

以上是内存溢出为你收集整理的linux – 使用“ip”命令在CentOS / RHEL 6中重新启动时保留IP地址别名全部内容,希望文章能够帮你解决linux – 使用“ip”命令在CentOS / RHEL 6中重新启动时保留IP地址别名所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1044070.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-24
下一篇 2022-05-24

发表评论

登录后才能评论

评论列表(0条)

保存