由于我已经改变了我的路由器,在一台PC上,我必须在每次重新启动后运行命令sudo dhclient eno1
。我已经升级到Xubuntu 20.04,但问题仍然存在。我怎么才能改变呢?
ifconfig -a
的结果:
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.10 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::729a:2013:ba7e:ba02 prefixlen 64 scopeid 0x20<link>
ether a4:5d:36:82:ba:53 txqueuelen 1000 (Ethernet)
RX packets 8032 bytes 8241625 (8.2 MB)
RX errors 0 dropped 8 overruns 0 frame 0
TX packets 5851 bytes 763496 (763.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
我正在使用eno1 (有线以太网),IP 192.168.0.10是正确的(为我的MAC地址配置在路由器上的固定IP地址)。
@Thomas:/etc/netplan
目录中没有文件
@特伦斯:不:/etc/dhcpcd.conf
不存在
在/etc/dhcp/dhclient.conf
中,唯一不是注释的行是:
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
send host-name = gethostname();
request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, domain-search, host-name,
dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
netbios-name-servers, netbios-scope, interface-mtu,
rfc3442-classless-static-routes, ntp-servers;
timeout 300;
发布于 2021-12-19 13:42:30
由于您使用ifupdown
控制您的网络接口,请确保将以下两行添加到/etc/network/interfaces
文件中:
auto eno1
iface eno1 inet dhcp
第一行告诉系统在启动时自动打开接口。第二行告诉系统,接口将使用DHCP而不是静态的。
希望这能有所帮助!
https://askubuntu.com/questions/1382573
复制相似问题