当前位置:网站首页>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 .

边栏推荐
- Report on the "14th five year plan" and investment strategy recommendations for China's industrial robot industry 2022 ~ 2028
- Quickly understand what the compressed list in redis is
- 下半年还有很多事要做
- Operator-1初识Operator
- 【历史上的今天】7 月 1 日:分时系统之父诞生;支付宝推出条码支付;世界上第一支电视广告
- Wechat simulated geographical location_ Camouflage wechat location
- Operator-1 first acquaintance with operator
- ustime写出了bug
- 腾讯安全发布《BOT管理白皮书》|解读BOT攻击,探索防护之道
- R语言基于h2o包构建二分类模型:使用h2o.gbm构建梯度提升机模型GBM、使用h2o.auc计算模型的AUC值
猜你喜欢
![[20220605] Literature Translation -- visualization in virtual reality: a systematic review](/img/11/6c42957186bf530e8f9d4025a40197.png)
[20220605] Literature Translation -- visualization in virtual reality: a systematic review

逆向调试入门-PE结构-输入表输出表05/07

leetcode:241. 为运算表达式设计优先级【dfs + eval】

基因检测,如何帮助患者对抗疾病?

晓看天色暮看云,美图欣赏

Based on the open source stream batch integrated data synchronization engine Chunjun data restore DDL parsing module actual combat sharing
![leetcode:329. The longest incremental path in the matrix [DFS + cache + no backtracking + elegance]](/img/10/acd162c3adf9d6f14fa5a551dc0d25.png)
leetcode:329. The longest incremental path in the matrix [DFS + cache + no backtracking + elegance]

VS Code 设置单击打开新文件窗口,不覆盖前一个窗口

路由基础之OSPF LSA详细讲解

Operator-1初识Operator
随机推荐
题目 1004: 母牛的故事(递推)
When Sqlalchemy deletes records with foreign key constraints, the foreign key constraints do not work. What is the solution?
Operator-1初识Operator
redis探索之缓存击穿、缓存雪崩、缓存穿透
codeforces -- 4B. Before an Exam
Powerful, easy-to-use, professional editor / notebook software suitable for programmers / software developers, comprehensive evaluation and comprehensive recommendation
leetcode:226. 翻转二叉树【dfs翻转】
Using burpsuite to capture app packages
Scene function of wooden frame
Zero copy technology of MySQL
leetcode:329. 矩阵中的最长递增路径【dfs + cache + 无需回溯 + 优雅】
redis探索之缓存一致性
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
The difference between memcpy and strcpy
基因检测,如何帮助患者对抗疾病?
Redis exploration: cache breakdown, cache avalanche, cache penetration
微信小程序 – 80个实用的微信小程序项目实例
Has anyone ever encountered this situation? When Oracle logminer is synchronized, the value of CLOB field is lost
Mobile note application
Class initialization and instantiation