如何在autoyast中将IP地址绑定到MAC?

如何在autoyast中将IP地址绑定到MAC?

是否可以在 autoyast 配置文件中将 IP 绑定到物理地址?下面的代码并不能解决这个问题:

     ...
<interfaces config:type="list">
      <interface>
        <bootproto>static</bootproto>
        <device>eth0</device>
        <ipaddr>ip_address_0</ipaddr>
        <hwaddr>aa:bb:cc:dd:ee:ff</hwaddr>
        <name>MY 1st NETWORK</name>
        <netmask>255.255.255.0</netmask>
        <startmode>auto</startmode>
        <usercontrol>no</usercontrol>
      </interface>
      <interface>
        <bootproto>static</bootproto>
        <device>eth1</device>
        <ipaddr>ip_address_1</ipaddr>
        <hwaddr>ff:aa:bb:cc:dd:ee</hwaddr>
        <name>MY 2nd NETWORK</name>
        <netmask>255.255.255.0</netmask>
        <startmode>auto</startmode>
        <usercontrol>no</usercontrol>
      </interface>
      <interface>
        <bootproto>static</bootproto>
        <device>eth2</device>
        <ipaddr>ip_address_2</ipaddr>
        <hwaddr>ee:ff:aa:bb:cc:dd</hwaddr>
        <name>MY 3rd NETWORK</name>
        <netmask>255.255.255.0</netmask>
        <startmode>auto</startmode>
        <usercontrol>no</usercontrol>
      </interface>  
      <interface>
        <bootproto>static</bootproto>
        <device>eth3</device>
        <ipaddr>ip_address_3</ipaddr>
        <hwaddr>dd:ee:ff:aa:bb:cc</hwaddr>
        <name>MY 4th NETWORK</name>
        <netmask>255.255.255.0</netmask>
        <startmode>auto</startmode>
        <usercontrol>no</usercontrol>
      </interface>        
      <interface>
        <bootproto>static</bootproto>
        <device>eth4</device>
        <ipaddr>ip_address_4</ipaddr>
        <hwaddr>cc:dd:ee:ff:aa:bb</hwaddr>
        <name>MY 5th NETWORK</name>
        <netmask>255.255.255.0</netmask>
        <startmode>auto</startmode>
        <usercontrol>no</usercontrol>
      </interface> 
      <interface>
        <bootproto>static</bootproto>
        <device>eth5</device>
        <ipaddr>ip_address_5</ipaddr>
        <hwaddr>bb:cc:dd:ee:ff:aa</hwaddr>
        <name>MY 6th NETWORK</name>
        <netmask>255.255.255.0</netmask>
        <startmode>auto</startmode>
        <usercontrol>no</usercontrol>
      </interface>         
    </interfaces>   
...

答案1

根据AutoYaST 规格,应该有一个单独的 udev 规则列表来将 NIC 的 MAC 地址映射到逻辑接口名称。

例如,您的控制文件应如下所示:

<networking>
 <interfaces config:type="list">
   <interface>
     <bootproto>static</bootproto>
     <device>eth0</device>
     <ipaddr>ip.ad.dr.es</ipaddr>
     <hwaddr>aa:bb:cc:dd:ee:ff</hwaddr>
     <netmask>255.255.255.0</netmask>
     <startmode>auto</startmode>
     <usercontrol>no</usercontrol>
   </interface>
 </interfaces>

 <net-udev config:type="list">
  <rule>
    <name>eth0</name>
    <rule>ATTR{address}</rule>
    <value>aa:bb:cc:dd:ee:ff</value>
  </rule>
 </net-udev>

</networking>

相关内容