当前位置:网站首页>VMware虚拟机更改静态IP和主机名,使用Xshell进行连接
VMware虚拟机更改静态IP和主机名,使用Xshell进行连接
2022-07-22 21:34:00 【时间是一种解药】
VMware虚拟机更改静态IP,使用Xshell进行连接
问题背景
使用centos操作系统,更改为静态IP时,有时候配置文件名不一样,可以自己配置
虚拟机静态IP配置
1 首先进入network配置的文件夹
cd /etc/sysconfig/network-scripts
ll
多个网络配置文件,需要删除,只剩一个配置文件
2 编辑网络配置文件,可能是ifcfg-eno16777736,或者是ifcfg-ens33
vim /etc/sysconfig/network-scripts/ifcfg-eno16777736
更改为
TYPE=Ethernet
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
NAME=eno16777736
UUID=73ef72e9-75a1-4ca6-9361-fb3674cda0fd
DEVICE=eno16777736
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.207.135
GATEWAY=192.168.207.2
NETMASK=255.255.255.0
DNS1=114.114.114.114

3 查看ip
ifconfig

4 关闭防火墙
systemctl stop firewalld
5 设置虚拟网络


6 打开本地网络设置



7 使用cmd的ping查看是否连通
ping 192.168.207.136

8 使用Xshell账号密码进行连接
更改主机名
1 进入root模式,修改服务器的主机名
hostnamectl --static set-hostname springcloud-1

2 添加域名映射
vim /etc/hosts
添加域名
192.168.207.135 springcloud-1
192.168.207.136 springcloud-2
192.168.207.137 springcloud-3

3 reboot重启虚拟机
reboot
4 在windows中添加域名映射,进入文件夹 C:\Windows\System32\drivers\etc 路径
5 关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
6 时区设置
yum install -y ntpdate
ntpdate time.windows.com
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
date
总结
自己经常用,老忘记,记录一下
作为程序员第 210 篇文章,每次写一句歌词记录一下,看看人生有几首歌的时间,wahahaha …


Lyric: 忘了左手的委屈
边栏推荐
- LeetCode(剑指 Offer)- 11. 旋转数组的最小数字
- 如何配置CANoe Network-based access模式的以太网网络拓扑
- Wechat campus second-hand book trading applet graduation design finished product (7) Interim inspection report
- 开幕在即 | “万物互联,使能千行百业”2022开放原子全球开源峰会OpenAtom OpenHarmony分论坛
- Z-Wave 800: Se firmware upgrade
- 打板遇到的问题
- Mysql A left(right) join B on A.id=B.id and A.age=1与A left(right) join B on A.id=B.id where A.age=1
- 21 -- 除自身以外数组的乘积
- 成功解决:error: src refspec master does not match any
- 主题域模型
猜你喜欢

1.10 API 和字符串

Mysql无法访问,navicat提示:is not allowed to connect to this MySQL server

Kubernetes deployment strategy

Part I sourcetree installation

Scala generic generic class details - t
![Leetcode 757 set the intersection size to at least 2[sort greedy] the leetcode path of heroding](/img/69/1bd10b65fe74041720944d0062c19e.png)
Leetcode 757 set the intersection size to at least 2[sort greedy] the leetcode path of heroding

延伸联接边界,扩展业务范围,全面迈向智能云网2.0时代

2022 employment season surprise! The genuine Adobe software can finally be used for nothing

直播实录 | 37 手游如何用 StarRocks 实现用户画像分析

pny 文件转图片
随机推荐
The new idea 2022.2 was officially released, and the new features are really fragrant
弥散张量分析开源软件 DSI Studio 简体中文汉化版可以下载了
不会吧?钉钉都下载了,你还不知道可以这样玩?
ROS2常用命令行工具整理ROS2CLI
如何配置CANoe Network-based access模式的以太网网络拓扑
Kubernetes 部署策略
Qt文档阅读笔记-QAudioInput&QAudioFormat解析与实例
Trees and binary trees
golang--module
局域网SDN技术硬核内幕 4 从计算虚拟化到网络虚拟化
2022 employment season surprise! The genuine Adobe software can finally be used for nothing
一文深入浅出理解国产开源木兰许可系列协议
Wechat campus second-hand book trading applet graduation design finished product (7) Interim inspection report
Inside the hard core of LAN SDN technology - evpn implementation of 16 three from thing to person user roaming in the park
Talk about 12 business scenarios of concurrent programming
我为OpenHarmony 写代码,战“码”先锋第二期正式开启!
Understand the domestic open source Magnolia license series agreement in simple terms
ASP.Net Core创建MVC项目上传多个文件(流方式)
Interpretation of URL structure
初出茅庐的小李第108篇博客二进制打印