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

边栏推荐
- 数字信号处理——线性相位型(Ⅱ、Ⅳ型)FIR滤波器设计(2)
- 买卖其实也有风险
- Application of stack -- bracket matching problem
- Perl 5.10.0 installation package download
- How to play with the reading and writing operations of blocking sockets?
- ROS2 Foxy depthai_ ROS tutorial
- 【历史上的今天】7 月 1 日:分时系统之父诞生;支付宝推出条码支付;世界上第一支电视广告
- 快速整明白Redis中的压缩列表到底是个啥
- Queue operation---
- Share several tools for designing exquisite circuit diagrams
猜你喜欢

MHA high availability cluster deployment and failover of database

CS5268优势替代AG9321MCQ Typec多合一扩展坞方案

Mobile note application

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

ROS2 Foxy depthai_ ROS tutorial

【邂逅Django】——(二)数据库配置

【历史上的今天】7 月 1 日:分时系统之父诞生;支付宝推出条码支付;世界上第一支电视广告

Vs code set code auto save

Stack-------

Based on the open source stream batch integrated data synchronization engine Chunjun data restore DDL parsing module actual combat sharing
随机推荐
工具箱之 IKVM.NET 项目新进展
简单斐波那契(递推)
Need your own cognition
Perl 5.10.0 installation package download
Scene function of wooden frame
mysql统计账单信息(下):数据导入及查询
MySQL的零拷贝技术
Understanding of NAND flash deblocking
VS Code 设置代码自动保存
Double linked list related operations
List of QT players [easy to understand]
Exploration and practice of inress in kubernetes
Teach you to complete the actual battle of image classification hand in hand -- Image Recognition Based on convolutional neural network
VS Code 设置单击打开新文件窗口,不覆盖前一个窗口
leetcode:226. 翻转二叉树【dfs翻转】
软件测试中功能测试流程
王兴的无限游戏迎来“终极”一战
logstash报错:Cannot reload pipeline, because the existing pipeline is not reloadable
天青色等烟雨
localtime居然不可重入,踩坑了