我在服务器中有这个配置
/etc/network/interfaces
auto em1
iface em1 inet static
address 192.168.1.250
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
Run Code Online (Sandbox Code Playgroud)
/etc/NetworkManager/system-connections/wired-conexion
[connection]
id=wired-conexion
uuid=0c501f08acc5497cb7de8c815a297537
type=8023ethernet
[8023ethernet]
[ipv4]
method=manual
dns=8.8.8.8;
dns-search=8.8.4.4;
address1=192.168.1.250/24,192.168.1.1
[ipv6]
method=auto
ip6privacy=0
Run Code Online (Sandbox Code Playgroud)
然后我在/etc/network/interfaces文件中评论了这些行
# auto em1
# iface em1 inet static
# address 192.168.1.250
# network 192.168.1.0
# netmask 255.255.255.0
# broadcast 192.168.1.255
# gateway 192.168.1.1
Run Code Online (Sandbox Code Playgroud)
我重新启动了服务
service network-manager restart
Run Code Online (Sandbox Code Playgroud)
我失去了与服务器的通信,因为我是远程连接的。我的笔记本电脑有类似的配置,一切正常。/etc/network/interfaces当我使用网络管理器时,我认为该文件被忽略了,是吗?如果我再次取消注释这些行会再次起作用吗?
更新:更多配置(我更改管理-> true)并且/etc/network/interfaces应该被忽略
/etc/NetworkManager/system-connections/conexionname
[connection]
id=conexionname
uuid=8e603a9b-...
type=802-3-ethernet
[802-3-ethernet]
[ipv4]
method=manual
dns=8.8.8.8;
dns-search=8.8.4.4; …Run Code Online (Sandbox Code Playgroud)