Linux_Ubuntu20.04中ens33没有ip

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

ginger@ubuntu:~$ ifconfig -a
ens33: flags=4098<BROADCAST,MULTICAST>  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<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        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<UP,BROADCAST,RUNNING,MULTICAST>  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<link>
        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 毫秒

  • 9
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值