phpcms中的网站介绍页网络营销具有哪些优势和吸引力
- 作者: 多梦笔记
- 时间: 2026年02月17日 10:56
当前位置: 首页 > news >正文
phpcms中的网站介绍页,网络营销具有哪些优势和吸引力,电子工程世界注册,大良手机网站建设文章目录 1_问题原因2_nmcli 配置静态IP3_使用配置文件固定IP4_重启后存在的问题5_nmcli 补充 1_问题原因 CentOS 7 于 2014年6月发布#xff0c;基于 RHEL 7#xff0c;并在 2024年6月30日 结束维护。 CentOS 9 作为目前的最新版本#xff0c;今天闲来闲来无事下载下来后… 文章目录 1_问题原因2_nmcli 配置静态IP3_使用配置文件固定IP4_重启后存在的问题5_nmcli 补充 1_问题原因 CentOS 7 于 2014年6月发布基于 RHEL 7并在 2024年6月30日 结束维护。 CentOS 9 作为目前的最新版本今天闲来闲来无事下载下来后研究研究。 为了方便日后学习使用第一步就是配置静态IP方便ssh服务远程连接。 所以我按照以往配置静态ip的经验进行了如下操作 vim /etc/sysconfig/network-scripts/ifcfg-ens33但是发现并没有 NAT 网络的这个配置文件 进入该配置文件所在目录下查看详细信息 cd /etc/sysconfig/network-scripts ls发现如下文件 文件内容如下 [shenyanglocalhost network-scripts]$ cat readme-ifcfg-rh.txt NetworkManager stores new network profiles in keyfile format in the /etc/NetworkManager/system-connections/ directory.Previously, NetworkManager stored network profiles in ifcfg format in this directory (/etc/sysconfig/network-scripts/). However, the ifcfg format is deprecated. By default, NetworkManager no longer creates new profiles in this format.Connection profiles in keyfile format have many benefits. For example, this format is INI file-based and can easily be parsed and generated.Each section in NetworkManager keyfiles corresponds to a NetworkManager setting name as described in the nm-settings(5) and nm-settings-keyfile(5) man pages. Each key-value-pair in a section is one of the properties listed in the settings specification of the man page.If you still use network profiles in ifcfg format, consider migrating them to keyfile format. To migrate all profiles at once, enter:# nmcli connection migrateThis command migrates all profiles from ifcfg format to keyfile format and stores them in /etc/NetworkManager/system-connections/.Alternatively, to migrate only a specific profile, enter:# nmcli connection migrate profile_name|UUID|D-Bus_pathFor further details, see:
- nm-settings-keyfile(5)
- nmcli(1)大致意思就是老版本的配置文件已被弃用迁移到了/etc/NetworkManager/system-connections/目录中。 要一次迁移所有配置文件可以使用 nmcli connection migrate命令详细信息参考nmcli。 2_nmcli 配置静态IP
那么这个nmcli又是什么呢经过查阅资料得知
CentOS 9 默认使用 NetworkManager 管理网络而nmcli是 NetworkManager 命令行接口的缩写是一个用来进行网络配置、管理网络连接的命令工具可以简化网络设置尤其是在无头没有图形界面环境下。
所以我们可以尝试用它来设置一个静态 IP
sudo nmcli con mod ens33 ipv4.addresses 192.168.150.145⁄24 # IP地址,自己设置,要匹配网络范围
sudo nmcli con mod ens33 ipv4.gateway 192.168.150.2 # 网关,要和VMware中配置的虚拟网卡一致
sudo nmcli con mod ens33 ipv4.dns 192.168.150.2 # DNS服务器和网关一致即可 8.8.8.8 也可以
sudo nmcli con mod ens33 ipv4.method manual # IPv4配置方法设置为手动,也就是启用静态IP配置
sudo nmcli con up ens33 # 使配置生效查看是否配置成功
[shenyanglocalhost network-scripts]\( ifconfig
ens33: flags4099UP,BROADCAST,MULTICAST mtu 1500inet 192.168.150.145 netmask 255.255.255.0 broadcast 192.168.150.255inet6 fe80::20c:29ff:fea4:42bd prefixlen 64 scopeid 0x20linkether 00:0c:29:a4:42:bd txqueuelen 1000 (Ethernet)RX packets 0 bytes 0 (0.0 B)RX errors 0 dropped 0 overruns 0 frame 0TX packets 0 bytes 0 (0.0 B)TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[shenyanglocalhost network-scripts]\) ping www.baidu.com
PING www.baidu.com.localdomain (198.18.1.175) 56(84) 比特的数据。
64 比特来自 198.18.1.175 (198.18.1.175): icmp_seq1 ttl128 时间0.582 毫秒
64 比特来自 198.18.1.175 (198.18.1.175): icmp_seq2 ttl128 时间0.683 毫秒
64 比特来自 198.18.1.175 (198.18.1.175): icmp_seq3 ttl128 时间0.591 毫秒
64 比特来自 198.18.1.175 (198.18.1.175): icmp_seq4 ttl128 时间0.386 毫秒nmcli 配置到此完成 另外在配置前一定要注意自己的网络接口名称是否是ens33可以使用ifconfig或nmcli d命令查看如果不一致别忘了进行替换。 3_使用配置文件固定IP
还记得我们上面提到过的/etc/NetworkManager/system-connections/目录吗
编辑该目录下的配置文件也可以达到相同的效果 cd /etc/NetworkManager/system-connections/ ls可以看到对应的ens33.nmconnection文件修改内容如下 sudo vim ens33.nmconnection[connection] idens33 uuid2c1fb13d-391d-4add-9919-7cebb1f76782 typeethernet autoconnectfalse interface-nameens33[ethernet][ipv4] address1192.168.150.145⁄24,192.168.150.2 dns192.168.150.2; methodmanual[ipv6] addr-gen-modeeui64 methodauto[proxy]修改配置文件后需要重启网络服务以使更改生效。 sudo systemctl restart NetworkManager或者重启网卡 sudo nmcli connection reload # 重新加载配置文件, 并使网络连接生效 sudo nmcli con up ens33 # 重新启用网络接口并应用新的配置验证配置 ip a show ens332: ens33: BROADCAST,MULTICAST,UP,LOWER_UP mtu 1500 qdisc fq_codel state UP group default qlen 1000link/ether 00:0c:29:a4:42:bd brd ff:ff:ff:ff:ff:ffaltname enp2s1inet 192.168.150.145⁄24 brd 192.168.150.255 scope global noprefixroute ens33valid_lft forever preferred_lft foreverinet6 fe80::20c:29ff:fea4:42bd/64 scope link noprefixroute valid_lft forever preferred_lft forever可以看到看到 ens33 接口已经使用了配置的静态 IP 地址 192.168.150.145。 4_重启后存在的问题 部分版本可能出现重启后发现配置没有生效使用ifconfig命令也没有查看到对应的IP地址但是/etc/NetworkManager/system-connections/配置文件中的内容确实是我们配置之后的。 这是由于配置的网卡(比如ens33)没有设置自动连接造成的如果使用nmcli connection up ens33后再查看会发现配置生效了。 使用如下命令解决 sudo nmcli connection modify ens33 connection.autoconnect yes sudo systemctl restart NetworkManager还可以通过修改配置文件的方式确保网卡开机后自动连接 sudo vim /etc/NetworkManager/system-connections/ens33.nmconnection在文件中找到 [connection] 部分确保 autoconnect 设置为 true [connection] idens33 uuid2c1fb13d-391d-4add-9919-7cebb1f76782 typeethernet autoconnecttrue # 确保这一行设置为 true interface-nameens33使更改生效重新启动 NetworkManager sudo systemctl restart NetworkManager确保 NetworkManager 服务在系统启动时自动启动 sudo systemctl enable NetworkManager配置完毕后 ens33 在系统启动时就能自动连接了。 5_nmcli 补充 nmcli 的功能和作用 nmcli 允许用户执行以下常见的网络管理任务 配置有线和无线网络查看网络接口和连接的状态启动、停止、重新连接网络设置静态或动态 IP 地址管理 VPN 连接配置网络的代理设置等 nmcli 通常在需要通过命令行进行网络管理时非常有用尤其是在没有图形界面的服务器环境中。 基本语法nmcli [选项] 命令 [参数] 常用命令和用法 1.查看当前网络连接的状态包括接口、IP 地址等信息 nmcli device status示例输出 DEVICE TYPE STATE CONNECTION ens33 ethernet 已连接 ens33
lo loopback 连接(外部) lo 2.查看所有连接 列出所有网络连接包括有线、无线、VPN 等 nmcli connection show示例输出 NAME UUID TYPE DEVICE ens33 2c1fb13d-391d-4add-9919-7cebb1f76782 ethernet ens33
lo 4b7c1923-16d8-4f53-90f0-e17b9a6519e0 loopback lo 3.激活网络连接 激活特定的网络连接例如连接到一个 Wi-Fi 网络 nmcli connection up 连接名称例如连接到 ens33 nmcli connection up ens334.停用网络连接 停止一个网络连接断开 Wi-Fi、以太网等 nmcli connection down 连接名称例如断开 ens33 nmcli connection down ens335.配置无线网络 连接到一个无线网络 nmcli device wifi connect SSID password 密码示例 nmcli device wifi connect MyNetwork password MyPassword6.配置静态 IP 地址 设置静态 IP 地址 nmcli connection modify 连接名称 ipv4.addresses IP地址/子网掩码 ipv4.method manual nmcli connection up 连接名称示例 nmcli connection modify Wired connection 1 ipv4.addresses 192.168.1.100⁄24 ipv4.method manual nmcli connection up Wired connection 17.配置 DNS 服务器 设置 DNS 服务器 nmcli connection modify 连接名称 ipv4.dns 8.8.8.8 8.8.4.4 nmcli connection up 连接名称8.查看当前活动的 IP 地址 nmcli device show这将显示设备的详细信息包括当前的 IP 地址。 9.查看设备的详细信息 显示特定设备的详细信息如网络接口 eth0 或 wlan0 nmcli device show 设备名称示例 nmcli device show ens3310.断开 Wi-Fi 连接 nmcli device disconnect wlan0nmcli 选项和常见子命令说明device管理网络设备如启用/禁用设备、查看设备状态等。connection管理网络连接如激活、停用、修改连接等。general显示系统网络管理的基本信息如版本、状态等。wifi用于管理无线网络连接扫描、连接等。monitor实时监控网络状态、连接和设备事件。
相关文章
-
phpcms网站模板工作室注册条件
phpcms网站模板工作室注册条件
- 站长
- 2026年02月17日
-
phpcms网站建设手机做个人简历
phpcms网站建设手机做个人简历
- 站长
- 2026年02月17日
-
phpcms网站调研报告
phpcms网站调研报告
- 站长
- 2026年02月17日
-
phpmysql网站开发技术项目式教程wordpress图片上浮特效
phpmysql网站开发技术项目式教程wordpress图片上浮特效
- 站长
- 2026年02月17日
-
phpok做网站教程网络口碑营销
phpok做网站教程网络口碑营销
- 站长
- 2026年02月17日
-
phpstudy搭建网站教程wordpress怎么修改中文字体
phpstudy搭建网站教程wordpress怎么修改中文字体
- 站长
- 2026年02月17日
