Linux网卡配置以及如何设置虚拟网卡

1、使用ifconfig查看网卡IP

2、ifup/ifdown ens33来启用和禁用网卡

3、ifdown ens33 && ifup ens33 重启网卡

4、设置一块虚拟网卡

(1)将物理网卡拷贝一份并重命名

(2)修改虚拟网卡的IP地址及网卡名

(3)查看配置

 5、查看网卡是否连接

(1)mii-tool ens33或者ethtool ens33

6、更改主机名配置

可以在/etc/hostname 中修改,但是重启后才生效

hostnamectl set-hostname=xxx 不用重启也可以生效

7、DNS配置文件 /etc/resolv.conf

猜你喜欢

转载自blog.csdn.net/weixin_42774383/article/details/81350858