输入命令ip a,查看自己网卡编号,比如我的就是ens33 因为此图为虚拟机搭建的,所以网卡名称为ens33,如果是真机的话则是enp0s**的名字 2.修改netwlpan文件 1 sudo vim /etc/netplwan/50-cloud-init.yaml 2 3 一下为默认配置文件 4 5 # This file is generated from information provided by 6 # the datasource. Changes to it will not p…
ubuntu以DHCP方式配置网卡自动获取ip编辑文件/etc/network/interfaces:sudo vi /etc/network/interfaces并用下面的行来替换有关eth0的行:# The primary network interface - use DHCP to find our addressauto eth0iface eth0 inet dhcp.…
@echo off echo 正在自动获取IP地址.... set 连接名称=以太网 netsh interface ip set address name = "%连接名称%" source = dhcp echo 正在自动获取DNS ,请稍等...... netsh interface ip set dns "%连接名称%" source = dhcp echo 设置完成! pause//以太网是win10的名称 win7是网络连接 根据系统更改即可…