Ubuntu16.04桥接下配置固定IP

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sureSand/article/details/81518032

为了搭建我的k8s集群,需要配置vmware的ubutun虚拟机

首先将网络适配器配成桥接
这里写图片描述

然后自己电脑cmd下ipconfig查看自己的网关和网段
这里写图片描述

我的网关是192.168.1.1,网段是192.168.1.xxx

所以在虚拟机ubuntu命令

vim /etc/network/interfaces

auto lo
iface lo inet loopback

auto ens33

iface ens33 inet static

address 192.168.1.101

netmask 255.255.255.0

gateway 192.168.1.1

扫描二维码关注公众号,回复: 2999536 查看本文章

然后设置阿里的dns:

 vim /etc/resolvconf/resolv.conf.d/base

nameserver 223.5.5.5

然后reboot重启服务器就完成了静态ip的设置

猜你喜欢

转载自blog.csdn.net/sureSand/article/details/81518032