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

边栏推荐
- Has won Huawei's 8.5 billion yuan screen order? Vicino responded: the customer asked for confidentiality and could not reply!
- 软件架构与设计(四)-----数据流架构
- 融云实时社区解决方案
- 2. Self narration of open source GPS project hd-gr GNSS
- 7、实时数据备份和实时时钟相关定义
- Baidu proposes a dynamic self distillation method to realize dense paragraph retrieval by combining interactive model and double tower model
- 2、开源GPS项目HD-GR GNSS的自叙
- Easyexcel complex header export (one to many)
- Daily news on July 28, 2022: Science: AI has made another breakthrough in protein design, and can design specific functional proteins
- shell编程规范与变量
猜你喜欢

详解.NET的求复杂类型集合的差集、交集、并集

FTP file transfer protocol

Perception of life

生命的感悟

爬虫入门(1)——requests(1)

FTP文件传输协议

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

Self cultivation of programmers

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

PXE网络装机
随机推荐
Close independent windows and close other windows at the same time
使用Mock技术帮助提升测试效率的小tips,你知道几个?
数牍 X Rust,那些不得不说的事
About the pictures inserted in the word document, only the following part is displayed
Stateflow逻辑系统建模
leetcode-括号有效性问题
10. Implementation of related data accumulation task
Summarize the knowledge points of the ten JVM modules. If you don't believe it, you still don't understand it
Deutsche Telekom denied strengthening its cooperation with Huawei and said it had reduced its cooperation with Huawei in the past three years
An article about rsocket protocol
Youdao cloud notes remove the bottom advertisement
8、实时数据备份和实时时钟功能实现
try...except异常处理语句(6)
Rxdart is used instead of stateful in fluent
File and directory operations (5)
程序员的自我修养
多线程
8. Realization of real-time data backup and real-time clock function
Camera continuous shooting automatic test shell script
Several slips of X rust, those things that have to be said