当前位置:网站首页>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: 忘了左手的委屈
边栏推荐
- 【刷题记录】18. 四数之和
- How to use the order flow analysis tool (Part 2)
- Delete the duplicate items in the array (keep the last duplicate elements and ensure the original order of the array)
- 文件上传,服务器文件名中文乱码文件上传,服务器文件名中文乱码
- LAN SDN technology hard core insider 4 from computing virtualization to network virtualization
- 牛客小白月赛53
- redis 哨兵模式,主节点检查脚本
- 弥散张量分析开源软件 DSI Studio 简体中文汉化版可以下载了
- 局域网SDN技术硬核内幕 6 分布式任意播网关
- 6-13漏洞利用-smtp暴力破解
猜你喜欢

Wechat hotel reservation applet graduation project (7) Interim inspection report

1.10 API 和字符串

Small program completion work wechat campus second-hand book trading small program graduation design finished product (2) small program function

Wechat campus second-hand book trading applet graduation design finished product (5) assignment

工作流引擎在vivo营销自动化中的应用实践

Scala generic generic class details - t

浅谈性能优化:APP的启动流程分析与优化

Scala Generic 泛型类详解 - T

Basic commands of redis' five basic data types

4G传输模块的功能应用
随机推荐
Delete the duplicate items in the array (keep the last duplicate elements and ensure the original order of the array)
局域网SDN硬核技术内幕 18 美丽新世界
Wechat hotel reservation applet graduation project (6) opening defense ppt
6-13漏洞利用-smtp暴力破解
开幕在即 | “万物互联,使能千行百业”2022开放原子全球开源峰会OpenAtom OpenHarmony分论坛
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
Kubernetes 部署策略
升级poi-tl版本1.12.0与旧版poi(4.1.2)、easyexcel之间的依赖冲突解决
Alibaba Cloud Security Center's best practices for vulnerability repair
大厂底层必修:“应用程序与 AMS 的通讯实现”
如何保护 JDBC 应用程序免受 SQL 注入
Problems encountered in punching
沃尔沃xc90的安全性如何?一起来看看吧
Mysql的索引为什么用B+树而不是跳表?
【开发技术】SpingBoot数据库与持久化技术,JPA,MongoDB,Redis
pny 文件转图片
ROS based navigation framework
With 130 new services and functions a year, this storage "family bucket" has grown again
RN底层原理 -- 1. Component和PureComponent解析
毕业设计-----基于STM32的物联网环境检测系统