当前位置:网站首页>虚拟机之NAT模式下设置静态IP
虚拟机之NAT模式下设置静态IP
2022-07-28 14:40:00 【1 2 3 一起追梦】
1、打开虚拟网络配置看NAT模式下的网关,IP区间。


2、进入到配置文件
vim /etc/sysconfig/network-scripts/ifcfg-ens33
3、 修改配置文件
TYPE=Ethernet
#改成static
BOOTPROTO=static
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=1899af37-70a5-4ad2-bde6-73b4e141582e
DEVICE=ens33
ONBOOT=yes#ip地址
IPADDR=192.168.1.130#网关
GATEWAY=192.168.1.2#dns域名解析器
DNS1=114.114.114.114#dns域名解析器
DNS2=8.8.8.8#子网掩码
NETMASK=255.255.255.0
HWADDR=00:0c:29:a1:40:20
4、重启网络
systemctl restart network
5、测试
ping百度服务器能发包接受包说明成功了

边栏推荐
猜你喜欢

软件架构与设计(十)-----架构技术

Rongyun real-time community solution

Software architecture and design (VIII) -- distributed architecture

Explain the difference set, intersection set and union set of complex type set in detail.Net

Baidu proposes a dynamic self distillation method to realize dense paragraph retrieval by combining interactive model and double tower model

FTP文件传输协议

How to obtain and embed go binary execution package information

Flowable workflow all business concepts

2022年最火的十大测试工具,你掌握了几个

PXE network installation
随机推荐
Framework customization series (I) -- systemui NavigationBar slide back to launcher on the navigation bar
Five connection modes of QT signal and slot
详解.NET的求复杂类型集合的差集、交集、并集
3. Basic constants and macro definitions
Daily news on July 28, 2022: Science: AI has made another breakthrough in protein design, and can design specific functional proteins
有奖活动分享:使用WordPress搭建一个专属自己的博客后最高可领取iPhone13
About the pictures inserted in the word document, only the following part is displayed
华为全球员工总数创新高:19.4万人,研发人员占比近50%
Deutsche Telekom denied strengthening its cooperation with Huawei and said it had reduced its cooperation with Huawei in the past three years
德国电信否认加强与华为合作,并称过去3年已缩减与华为的合作
Framework customization series (VI) -- shield fallbackhome mobile phone from pop-up during startup and directly enter the launcher
生命的感悟
samba服务器搭建指南
软件架构与设计(十)-----架构技术
Endnote 与word关联
1. Author of the open source GPS project hd-gr GNSS
Virturalbox solves the problem of kernel driver
Easyexcel complex header export (one to many)
PXE network installation
Give you a linked list, delete the penultimate node of the linked list, and return the head node of the linked list.