当前位置:网站首页>虚拟机之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百度服务器能发包接受包说明成功了

边栏推荐
- 8. Realization of real-time data backup and real-time clock function
- Share the HR experience of the first and second tier companies
- Framework customization series (VI) -- shield fallbackhome mobile phone from pop-up during startup and directly enter the launcher
- 跟我学Rx编程——Concat
- Summary and arrangement of postgraduate entrance examination information of 985 colleges and universities nationwide
- Stateflow逻辑系统建模
- 爬虫入门(1)——requests(1)
- DNS域名解析协议
- Five connection modes of QT signal and slot
- 字符数组和字符串的区别
猜你喜欢

使用Mock技术帮助提升测试效率的小tips,你知道几个?

软件架构与设计(四)-----数据流架构

NFTScan 与 NFTPlay 在 NFT 数据领域达成战略合作

Canoe tutorial

一文了解 Rainbond 云原生应用管理平台

Flowable workflow all business concepts

Among the three "difficult and miscellaneous diseases" of machine learning, causal learning is the breakthrough | Liu Li, Chongqing University

vs动态库调试

Nftscan and nftplay have reached strategic cooperation in the field of NFT data

Voice social system -- improve the audio system industry chain
随机推荐
An article about rsocket protocol
Self cultivation of programmers
QCustomPlot绘图工具常用方法
4. Main program and cumulative interrupt processing routine implementation code
Docker容器实现MySQL主从复制
Rongyun real-time community solution
Daily news on July 28, 2022: Science: AI has made another breakthrough in protein design, and can design specific functional proteins
Summary and arrangement of postgraduate entrance examination information of 985 colleges and universities nationwide
一篇文章了解RSocket协议
Rxdart is used instead of stateful in fluent
Framework customization series (VI) -- shield fallbackhome mobile phone from pop-up during startup and directly enter the launcher
22. Realization of message processing task
德国电信否认加强与华为合作,并称过去3年已缩减与华为的合作
Canoe tutorial
DNS域名解析协议
MATLAB不覆盖导入EXCEL
Docker实现Redis Cluster(集群)模式 哈希槽分区进行亿级数据存储
Flutter中是使用RxDart代替Stateful
2022年最火的十大测试工具,你掌握了几个
4、主程序和累积中断处理例程实现代码