当前位置:网站首页>VM virtual machine configuration dynamic IP and static IP access
VM virtual machine configuration dynamic IP and static IP access
2022-07-01 12:49:00 【51CTO】
VM Virtual machine configuration is dynamic ip And static ip visit
dynamic ip static state ip Configure the network adapters to NAT Pattern 
dynamic ip To configure
This is simpler .
Set up /etc/sysconfig/network-scripts/ A file in a directory ifcfg-ens33
The configuration file is as follows
then Virtual Network Editor Lower setup NAT Network check this item to use dynamic IP 了 
Set dynamic ip Range :
🥭 static state ip To configure
View our PC Default gateway of wireless network ( View by : Set up -》 View network properties ) How much is the , The virtual machine IP And gateway settings must be consistent with PC Wireless network gateway can realize communication in the same network segment 
In practical use, static IP, If the DHCP To automatically get IP Words As long as the network is disconnected WM Will regain the current IP Next IP, So it must be changed to static to prevent this embarrassing situation 0.0
static state ip The configuration file ifcfg-ens33 as follows
Follow the dynamic ip The difference is that
BOOTPROTO=static It's static IP The way ,
DNS1 Set to 114.114.114.114 Universal DNS
IPADDR static state ip Address
NETMASK Subnet mask
GATEWAY gateway
Be careful ip Set it to be in the same section as the gateway and subnet , At the same time, the subnet mask configuration file should also be consistent with the configuration .
If the gateway is set as the host, it is still ping No access to external network and host , Set the last bit of the gateway to .2, Such as :192.168.2.2

then Virtual Network Editor Lower setup NAT Network remember Don't check 
Remember to restart the network card configuration after configuration systemctl restart network.service
Set domain name resolution
Set static ip, Access to the Internet , But to perform ping www.baidu.com no , At this time, you need to configure domain name resolution vi /etc/resolv.conf
This is the end of this article ,
If you have any harvest, you are welcome to like, collect and pay attention to ️, Your encouragement is my biggest motivation .
If you have any wrong questions, you are welcome to point out .
Home page : Share a cup of no blog summaryKeep loving , Go to the next mountain and sea .

边栏推荐
- Operator-1初识Operator
- 华为HMS Core携手超图为三维GIS注入新动能
- What are the solutions for session sharing of highly paid programmers & interview questions series 118?
- Three stages of aho
- Ustime wrote a bug
- Operations related to sequence table
- 数据库之MHA高可用集群部署及故障切换
- Huawei interview question: Recruitment
- Update a piece of data from the database. Will CDC get two pieces of data with OP fields D and C at the same time? I remember before, only OP was U
- 强大、好用、适合程序员/软件开发者的专业编辑器/笔记软件综合评测和全面推荐
猜你喜欢

leetcode:226. 翻转二叉树【dfs翻转】

ROS2 Foxy depthai_ros教程

Ikvm of toolbox Net project new progress

使用nvm管理nodejs(把高版本降级为低版本)

Circular linked list--

codeforces -- 4B. Before an Exam

Wang Xing's infinite game ushers in the "ultimate" battle

Look at the sky at dawn and the clouds at dusk, and enjoy the beautiful pictures

codeforces -- 4B. Before an Exam

Stack-------
随机推荐
软件测试中功能测试流程
系统测试UI测试总结与问题(面试)
flinkcdc要实时抽取oracle,对oracle要配置什么东西?
微信模拟地理位置_伪装微信地理位置
Question d'entrevue de Huawei: recrutement
R语言基于h2o包构建二分类模型:使用h2o.gbm构建梯度提升机模型GBM、使用h2o.auc计算模型的AUC值
redis探索之缓存击穿、缓存雪崩、缓存穿透
Stack-------
Eurake分区理解
R language builds a binary classification model based on H2O package: using H2O GBM build gradient hoist model GBM, use H2O AUC value of AUC calculation model
用.Net Core接入微信公众号开发
華為面試題: 招聘
redis探索之缓存一致性
Accept different views with an open mind
Share several tools for designing exquisite circuit diagrams
First intention is the most important
List of QT players [easy to understand]
基因检测,如何帮助患者对抗疾病?
79. 单词搜索【dfs + 回溯visit + 遍历起点】
王兴的无限游戏迎来“终极”一战