Linux

您所在的位置:网站首页 以太网没有ip地址 Linux

Linux

2023-10-02 07:32| 来源: 网络整理| 查看: 265

今天换了一个工位(公司网络也是同一个),但是打开电脑虚拟机Ubtuntu连接不上网络,windows上的配置已经检查了一遍发现没什么问题,在Ubtun上发现 ens33 这个网卡根本没有分配ip。

ginger@ubuntu:~$ ifconfig -a ens33: flags=4098 mtu 1500 ether 00:0c:29:ef:77:09 txqueuelen 1000 (以太网) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73 mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10 loop txqueuelen 1000 (本地环回) RX packets 1771 bytes 127503 (127.5 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 1771 bytes 127503 (127.5 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

为ens33分配ip地址。

ginger@ubuntu:~$ sudo dhclient ens33 # 为ens33分配ip地址。 [sudo] ginger 的密码: cmp: EOF on /tmp/tmp.N9OslbPxVX which is empty ginger@ubuntu:~$ sudo ifconfig ens33 # 重新查看ens33网卡是否分配ip。 ens33: flags=4163 mtu 1500 inet 192.168.130.129 netmask 255.255.255.0 broadcast 192.168.130.255 inet6 fe80::20c:29ff:feef:7709 prefixlen 64 scopeid 0x20 ether 00:0c:29:ef:77:09 txqueuelen 1000 (以太网) RX packets 140 bytes 42852 (42.8 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 96 bytes 13787 (13.7 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

重新获取ip后,网络连接成功。

ginger@ubuntu:~$ ping www.baidu.com PING www.a.shifen.com (180.101.49.11) 56(84) bytes of data. 64 比特,来自 180.101.49.11 (180.101.49.11): icmp_seq=1 ttl=128 时间=9.64 毫秒 64 比特,来自 180.101.49.11 (180.101.49.11): icmp_seq=2 ttl=128 时间=9.58 毫秒 64 比特,来自 180.101.49.11 (180.101.49.11): icmp_seq=3 ttl=128 时间=9.31 毫秒 64 比特,来自 180.101.49.11 (180.101.49.11): icmp_seq=4 ttl=128 时间=8.79 毫秒 64 比特,来自 180.101.49.11 (180.101.49.11): icmp_seq=5 ttl=128 时间=10.6 毫秒 64 比特,来自 180.101.49.11 (180.101.49.11): icmp_seq=6 ttl=128 时间=9.77 毫秒 64 比特,来自 180.101.49.11 (180.101.49.11): icmp_seq=7 ttl=128 时间=10.7 毫秒 ^C --- www.a.shifen.com ping 统计 --- 已发送 7 个包, 已接收 7 个包, 0% 包丢失, 耗时 6014 毫秒


【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3