AM335X linux4.19 设置静态IP

79 阅读1分钟

1.修改80-container-host0.network文件

文件在/lib/systemd/network/80-container-host0.network

[Match]                                                                                                                                                  
Virtualization=container                                                                                                                                
Name=host0  
                                                                                                                                            
[Network]                                                                                                                                                
#DHCP=yes                              
LinkLocalAddressing=yes                                                                                                                                  

#[DHCP]
#UseTimezone=yes           

修改成上述形式。

2.增加01-eth-static.network文件

在/etc/systemd/network/文件夹下增加01-eth-static.network文件内容如下

[Match]
Name = eth0

[Network]
Address = xxxx
Broadcast = xxxx
Netmask = xxxx
Gateway =xxxx