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

边栏推荐
- 79. 单词搜索【dfs + 回溯visit + 遍历起点】
- Nc100 converts strings to integers (ATOI)
- [brain opening] west tide and going to the world series
- Ustime wrote a bug
- redis探索之缓存一致性
- 【开发大杀器】之Idea
- Topic 1004: the story of cows (recursion)
- 逆向调试入门-PE结构-输入表输出表05/07
- Powerful, easy-to-use, professional editor / notebook software suitable for programmers / software developers, comprehensive evaluation and comprehensive recommendation
- ROS2 Foxy depthai_ ROS tutorial
猜你喜欢
随机推荐
Circular linked list--
Application of stack -- bracket matching problem
The difference between memcpy and strcpy
买卖其实也有风险
華為面試題: 招聘
Three stages of aho
Has anyone ever encountered this situation? When Oracle logminer is synchronized, the value of CLOB field is lost
王兴的无限游戏迎来“终极”一战
codeforces -- 4B. Before an Exam
Question d'entrevue de Huawei: recrutement
[today in history] July 1: the father of time sharing system was born; Alipay launched barcode payment; The first TV advertisement in the world
Tencent security and KPMG released a regulatory technology white paper to analyze the "3+3" hot application scenarios
Operator-1 first acquaintance with operator
Scene function of wooden frame
Logstash error: cannot reload pipeline, because the existing pipeline is not reloadable
c语言学习
手把手教你完成图像分类实战——基于卷积神经网络的图像识别
Manage nodejs with NVM (downgrade the high version to the low version)
【历史上的今天】7 月 1 日:分时系统之父诞生;支付宝推出条码支付;世界上第一支电视广告
【开发大杀器】之Idea








