redhat – 通过DHCP进行Linux静态路由配置

前端之家收集整理的这篇文章主要介绍了redhat – 通过DHCP进行Linux静态路由配置前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有一堆RedHat虚拟机,我需要设置静态IPv4路由表.我想集中这个配置,我想到了可以提供这些信息的DHCP服务(参见RFC3442).

> RHEL 5和RHEL6附带的任何DHCP客户端
支持功能
>还有其他替代方法来进行路由表配置吗?
>切换到IPv6会简化这种配置吗?

欢迎任何其他想法.

见:RFC3442 – Classless Static Route Option for DHCPv4

解决方法

您是否考虑通过Puppet或Chef处理此事?我认为编写一个模块可以相当容易,该模块将检查以确保路由存在并在它们不可用时应用它们.这为您提供了与单个DHCP服务配置文件相同的灵活性和集中控制.

如果使用静态IP设置VM,则可以在网络接口的路由配置文件中设置该文件,例如’/ etc / sysconfig / network-scripts / route-eth0′.这也可以通过配置管理工具轻松管理.

如果您希望通过DHCP执行此操作,请确保根据RedHat知识库文章(https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/6/html/6.1_Technical_Notes/ar01s04s05.html)正确配置了DHCP客户端

To ensure that RFC3442-standard classless static routes provided by a
DHCP server are processed correctly when using NetworkManager,the
following lines should be placed into /etc/dhclient.conf or,if using
per-interface DHCP options,/etc/dhclient-<ifname>.conf:

option rfc3442-classless-static-routes code 121 = array of unsigned integer 8; 
option ms-classless-static-routes code 249 = array of unsigned integer 8; 
also request rfc3442-classless-static-routes;
also request ms-classless-static-routes;

These lines will ensure that RFC3442 classless static routes are requested from the DHCP server,and that they are properly processed by NetworkManager.

原文链接:https://www.f2er.com/linux/395522.html

猜你在找的Linux相关文章