云计算:OpenStack 配置云主机实例的存储挂载并实现外网互通

news/2025/1/18 9:54:03/

目录

一、实验

1. 环境

2.配置存储挂载

3.云主机实例连接外部网络(SNAT)

4.外部网络连接云主机实例(DNAT)

二、问题

1.云主机 ping 不通外部网络

2.nova list 查看云主机列表报错

3.nova list 与 virsh list --all有何区别

4.OpenStack如何查看虚拟路由器

5.OpenStack如何查看虚拟DHCP服务器


 

 

一、实验

1. 环境

(1)宿主机

表1 宿主机

主机架构IP地址
openstackall in one192.168.199.201

(2)云主机

表2 云主机

 主机架构IP地址

浮动IP

cs_01云主机

         172.25.1.109   

192.168.199.87

cs_02云主机

        172.25.2.107

192.168.199.82

 

2.配置存储挂载

(1)项目devops03用户user01

54f281f882c74a94b11e80863be1142f.png25fbaf24670a49a4a6c780282bb6527b.png

(2)创建卷

799695fe8ca742db91164d943da22d40.png

(3)创建中

18398804fef34feca9f3882a24be1edf.png

(4)完成

cf365275980d42968dd47d4698f48f88.png

(5)登录云主机cs_01控制台1cd67cc4b6534cadbc9b5e8a2c1f8035.png

(6)查看分区情况

eb9c22e16d15420b861349194d47343c.png

(7)管理与连接卷

ad5c06d6037b4495a7834e178d5710ce.png

(8)连接中

1806661aa6924898afd1335824124f17.png

(9)完成

0c5b9238c0ea46beb526da0e26cd830a.png

(10)云主机cs_01控制台查看分区情况

新增磁盘vdb

8d528704bc2c4b5691300035b3e481cb.png

(11) 分区

8255b1531d4d4975bde563f09acee1c7.pngc29cb3b33f754cb69e5017eaef3e03c8.png

(12)查看

89ff375ba95241898b4a5bf397ec1672.png

(13)格式化为ext4文件系统

ed429e19f33340fba4a5082574595a07.png

(14)挂载(会弹出提示,不影响最终挂载)

9e479318ddda4b9e9503b0e01aa96966.png

(15)查看挂载情况

e2b5167e66344fc49ed340d26ee3b6ee.png

 

3.云主机实例连接外部网络(SNAT)

(1)查看当前网络拓扑

79071dcd117d472a99a5b1ea9b0968ba.png

(2)分配浮动IP给云主机cs_01

378e294a1d6f453abc8d80ccedb15894.png

(3)查看

ee6bd70b1eca45e8a8fae02c7072ff75.png

(4)管理浮动IP的关联

ad4f9d6148a24a7f8ef523281af30875.png

(5)已绑定

24efedbb379543f38828bb023475fba4.png


(6)查看实例情况

cca5cbce6a7943558a85ccf323a0e670.png

(7)分配浮动IP给云主机cs_02

48fc791815624f30a5b40deb0e41d09d.png

(8)查看

5a095c7fd455417ca4cf50cfee5f2931.png

(9)点击”绑定浮动IP“

5c3fb0ac60c2471487e857d72b0a8ed5.png

(10)管理浮动IP的关联

f33b8ac6ff704aad9bc0a58249d0018c.png

(11)已绑定

a45bdb9020174970b952a82006d2cf30.png
 

(12)宿主机查看路由信息

5334cf2174db414dbd59a1082496fffd.png

87471872bcdf4edc9efecd9504b8e1e1.png

(13)宿主机添加流表信息cda9dca5c6ba48c5825981738ea0800f.png

6750c4eff17a42ba90f8b49158f347ac.png

(16)云主机 ping 外部网络成功

3bab96cf6dc740ed9391469523cd1e66.png

 

4.外部网络连接云主机实例(DNAT)

(1)查看当前安全组

9df792f84e8e40159fcfe592550fbd82.png

(2)添加规则

d512fa3fe4c44838a2e7defceda6814e.png

(3)查看安全组规则

409c0174ffe14919ab52fe40f6d55755.png

(4)继续添加规则61bba8c0a36b4a8ebf2cd6d2170a43d1.png

(4)再次查看查看安全组规则8fefa02f94b94fa3b4505e97ac149199.png

(5)查看网络拓扑图27ebd21e46d9485ba244483c14a5f0fe.png

94c51d6e679848ea95ed562203d4fd5b.png

 

(6)Windows11系统 ping 云主机cs_01

ace676ba49f54995bc3844b147611fa6.png

(7)Windows11系统 ping 云主机cs_02

7ce445357cf244809484dc1d5bd3d33f.png

 

 

二、问题

1.云主机 ping 不通外部网络

(1)报错

14e183b387e748e2aa57bbadaf324ceb.png

(2)原因分析

未配置流表。

OpenFlow是用于管理交换机流表的协议,ovs-ofctl是Open vSwitch提供的命令行工具。在没有配置OpenFlow控制器的模式下,用户可以使用ovs-ofctl命令通过OpenFlow协议连接Open vSwitch来创建、修改或删除Open vSwitch中的流表项,并对Open vSwitch的运行状况进行动态监控。ovs-ofctl关于流表管理的常用命令如下表所示。

53f61a6c1e654fb2b2a18404a59b299b.png

对于add-flow、add-flows和mod-flows这3个命令,还需要指定要执行的动作actions=[target],[target],一个流规则中可能有多个动作,按照指定的先后顺序执行。
常见的流表操作如下表所示。

a81c72cf74c242db8f7ebada39249477.png

在OpenFlow白皮书中,Flow被定义为某个特定的网络流量。例如,一个TCP连接就是一个Flow,或者从某个IP地址发出来的数据包,都可以被认为是一个Flow。支持OpenFlow协议的交换机应该包括一个或多个流表,流表中的条目包含:数据包头的信息、匹配成功后要执行的指令和统计信息。当数据包进入OVS后,会将数据包和流表中的流表项进行匹配,如果发现了匹配的流表项,则执行该流表项中的指令集。相反,如果数据包在流表中没有发现任何匹配,OVS会通过控制通道把数据包发到OpenFlow控制器中。在OVS中,流表项作为ovs-ofctl的参数,采用如下的格式:字段=值,如果有多个字段,可以用逗号或空格分开,一些常用的字段列举如下表所示。

b6d868e0c7894d0e875663890833b179.png

(3)解决方法

命令行输入添加流表。

① 基础网络配置

1)br-ex 
连接外部网络(external)2)br-tun
连接隧道网络(tunnel)3)br-int
综合网桥(integration)

② 查看网桥(虚拟交换机)的基本信息

[root@openstack ~]# ovs-vsctl show
db90689c-619b-4abe-bcbf-16563efed45bManager "ptcp:6640:127.0.0.1"is_connected: trueBridge br-intController "tcp:127.0.0.1:6633"is_connected: truefail_mode: securePort "qg-ff43c0db-46"tag: 3Interface "qg-ff43c0db-46"type: internalPort "tap2d46a37a-12"tag: 3Interface "tap2d46a37a-12"type: internalPort br-intInterface br-inttype: internalPort "qr-68faaa7e-cc"tag: 1Interface "qr-68faaa7e-cc"type: internalPort "tapd441263b-ea"tag: 2Interface "tapd441263b-ea"type: internalPort "qvo7b9dd20c-6e"tag: 1Interface "qvo7b9dd20c-6e"Port "qvo04708a06-18"tag: 2Interface "qvo04708a06-18"Port int-br-exInterface int-br-extype: patchoptions: {peer=phy-br-ex}Port "tap1a095310-18"Interface "tap1a095310-18"type: internalPort "tapc64270af-df"tag: 1Interface "tapc64270af-df"type: internalPort "qr-df3559a2-e7"tag: 2Interface "qr-df3559a2-e7"type: internalPort patch-tunInterface patch-tuntype: patchoptions: {peer=patch-int}Bridge br-tunController "tcp:127.0.0.1:6633"is_connected: truefail_mode: securePort patch-intInterface patch-inttype: patchoptions: {peer=patch-tun}Port br-tunInterface br-tuntype: internalBridge br-exController "tcp:127.0.0.1:6633"is_connected: truefail_mode: securePort br-exInterface br-extype: internalPort phy-br-exInterface phy-br-extype: patchoptions: {peer=int-br-ex}Port "ens33"Interface "ens33"ovs_version: "2.7.3"

8734370590144dfe8ecc1275f092574f.png

c735b1243a9a43b8b72bc5b0c8d81774.png32488802dd8b4dd787870d2ab6bd6020.pngcfa7766905fb43e2886cc8c58effa621.png
③ 查看br-ex虚拟交换机上各端口的状态

输出的结果中包含了各端口上收到的数据包数,字节数,丢包数,错误数据包数等。

[root@openstack ~]# ovs-ofctl dump-flows br-ex
NXST_FLOW reply (xid=0x4):cookie=0x0, duration=25482.541s, table=0, n_packets=964, n_bytes=43532, idle_age=10005, in_port=2 actions=ALcookie=0x3ee824d85c7adea0, duration=34310.012s, table=0, n_packets=369061, n_bytes=82371938, idle_age=0, pr

e86c56967e8049bbb672d6dbf225affe.png

5c61fc09336645c88ac9b3774fcec253.png

④ 查看br-ex桥的流表信息(重点关注序号)

ovs-ofctl show br-ex 
[root@openstack ~]# ovs-ofctl show br-ex
OFPT_FEATURES_REPLY (xid=0x2): dpid:0000000c295385ce
n_tables:254, n_buffers:0
capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_1(ens33): addr:00:0c:29:53:85:ceconfig:     0state:      0current:    1GB-FD COPPER AUTO_NEGadvertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEGsupported:  10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEGspeed: 1000 Mbps now, 1000 Mbps max2(phy-br-ex): addr:12:67:6d:8e:d4:dcconfig:     0state:      0speed: 0 Mbps now, 0 Mbps maxLOCAL(br-ex): addr:00:0c:29:53:85:ceconfig:     0state:      0speed: 0 Mbps now, 0 Mbps max
OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0

622e700d644f42e89a611fdde1b48731.pnga8253a350826450398bb7c18a3a49ba1.png

⑤查看br-int桥的流表信息(重点关注序号)

[root@openstack ~]# ovs-ofctl show br-int
OFPT_FEATURES_REPLY (xid=0x2): dpid:000006b7f9bd7d47
n_tables:254, n_buffers:0
capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_2(patch-tun): addr:c2:48:6b:4a:78:56config:     0state:      0speed: 0 Mbps now, 0 Mbps max10(int-br-ex): addr:b6:76:78:81:41:ddconfig:     0state:      0speed: 0 Mbps now, 0 Mbps max11(qr-68faaa7e-cc): addr:00:00:00:00:10:c3config:     PORT_DOWNstate:      LINK_DOWNspeed: 0 Mbps now, 0 Mbps max12(qr-df3559a2-e7): addr:00:00:00:00:e0:99config:     PORT_DOWNstate:      LINK_DOWNspeed: 0 Mbps now, 0 Mbps max13(qg-ff43c0db-46): addr:00:00:00:00:20:5dconfig:     PORT_DOWNstate:      LINK_DOWNspeed: 0 Mbps now, 0 Mbps max14(tap1a095310-18): addr:00:00:00:00:10:80config:     PORT_DOWNstate:      LINK_DOWNspeed: 0 Mbps now, 0 Mbps max15(tap2d46a37a-12): addr:00:00:00:00:f0:9fconfig:     PORT_DOWNstate:      LINK_DOWNspeed: 0 Mbps now, 0 Mbps max16(tapc64270af-df): addr:02:ec:b9:56:6c:04config:     PORT_DOWNstate:      LINK_DOWNspeed: 0 Mbps now, 0 Mbps max17(tapd441263b-ea): addr:00:00:00:00:b0:39config:     PORT_DOWNstate:      LINK_DOWNspeed: 0 Mbps now, 0 Mbps max18(qvo04708a06-18): addr:0a:84:80:cb:e4:50config:     0state:      0current:    10GB-FD COPPERspeed: 10000 Mbps now, 0 Mbps max19(qvo7b9dd20c-6e): addr:7a:22:2b:be:43:4cconfig:     0state:      0current:    10GB-FD COPPERspeed: 10000 Mbps now, 0 Mbps maxLOCAL(br-int): addr:06:b7:f9:bd:7d:47config:     PORT_DOWNstate:      LINK_DOWNspeed: 0 Mbps now, 0 Mbps max
OFPT_GET_CONFIG_REPLY (xid=0x4): frags=normal miss_send_len=0

ee88ab8f192d44e4aa40d44aa3950fc8.pngc45c2e48296e4412a63f3ae86b12688e.pnge8a6076211fd4d688308210afe6be96f.png

⑥查看br-int虚拟交换机上各端口的状态

[root@openstack ~]# ovs-ofctl dump-flows br-int
NXST_FLOW reply (xid=0x4):cookie=0xc40afaa44e3bf01c, duration=35262.046s, table=0, n_packets=13199, n_bytes=1029702, idle_age=1, priority=2,in_port=10 actions=drcookie=0xc40afaa44e3bf01c, duration=33864.921s, table=0, n_packets=1447, n_bytes=141992, idle_age=10954, priority=9,in_port=18 actions=cookie=0xc40afaa44e3bf01c, duration=33022.776s, table=0, n_packets=119, n_bytes=11871, idle_age=16595, priority=9,in_port=19 actions=recookie=0x0, duration=4.201s, table=0, n_packets=0, n_bytes=0, idle_age=4, in_port=13 actions=ALLcookie=0xc40afaa44e3bf01c, duration=33864.919s, table=0, n_packets=0, n_bytes=0, idle_age=33864, priority=10,icmp6,in_port=18,icmp_typemit(,24)cookie=0xc40afaa44e3bf01c, duration=33022.774s, table=0, n_packets=0, n_bytes=0, idle_age=33022, priority=10,icmp6,in_port=19,icmp_typemit(,24)cookie=0xc40afaa44e3bf01c, duration=33864.917s, table=0, n_packets=115, n_bytes=4830, idle_age=10959, priority=10,arp,in_port=18 actioncookie=0xc40afaa44e3bf01c, duration=33022.772s, table=0, n_packets=10, n_bytes=420, idle_age=16593, priority=10,arp,in_port=19 actions=cookie=0xc40afaa44e3bf01c, duration=35263.424s, table=0, n_packets=2752, n_bytes=239758, idle_age=10954, priority=0 actions=resubmit(,6cookie=0xc40afaa44e3bf01c, duration=35263.425s, table=23, n_packets=0, n_bytes=0, idle_age=35263, priority=0 actions=dropcookie=0xc40afaa44e3bf01c, duration=33864.920s, table=24, n_packets=0, n_bytes=0, idle_age=33864, priority=2,icmp6,in_port=18,icmp_type0::f816:3eff:fedb:3d7d actions=resubmit(,60)cookie=0xc40afaa44e3bf01c, duration=33022.775s, table=24, n_packets=0, n_bytes=0, idle_age=33022, priority=2,icmp6,in_port=19,icmp_type0::f816:3eff:fe35:1ec9 actions=resubmit(,60)cookie=0xc40afaa44e3bf01c, duration=33864.918s, table=24, n_packets=115, n_bytes=4830, idle_age=10959, priority=2,arp,in_port=18,arp_spions=resubmit(,25)cookie=0xc40afaa44e3bf01c, duration=33022.773s, table=24, n_packets=10, n_bytes=420, idle_age=16593, priority=2,arp,in_port=19,arp_spa=ns=resubmit(,25)cookie=0xc40afaa44e3bf01c, duration=35263.423s, table=24, n_packets=0, n_bytes=0, idle_age=35263, priority=0 actions=dropcookie=0xc40afaa44e3bf01c, duration=33864.922s, table=25, n_packets=1560, n_bytes=146682, idle_age=10954, priority=2,in_port=18,dl_src=actions=resubmit(,60)cookie=0xc40afaa44e3bf01c, duration=33022.778s, table=25, n_packets=127, n_bytes=12151, idle_age=16593, priority=2,in_port=19,dl_src=fations=resubmit(,60)cookie=0xc40afaa44e3bf01c, duration=35263.424s, table=60, n_packets=4439, n_bytes=398591, idle_age=10954, priority=3 actions=NORMAL

824b766600c64ea49541be98868d18cb.png
⑦修改br-ex 流表信息

[root@openstack ~]# ovs-ofctl del-flows br-ex "in_port=2" 
[root@openstack ~]# ovs-ofctl add-flow  br-ex  in_port=1,actions=all

b985bb80f8e1443abf49949cc9a853a7.png

⑧  修改br-int 流表信息

[root@openstack ~]# ovs-ofctl del-flows br-int "in_port=13"
[root@openstack ~]# ovs-ofctl add-flow  br-int in_port=10,actions=all

2668dcb221f341cfb9e35a90b70e0689.png

⑨ 云主机 ping 外部网络成功

0cd8bf424a364f2b8292d69323b48638.png

 

2.nova list 查看云主机列表报错

(1)报错

bc57ea0c58eb46219f0642002cacab79.png

14ebe1c61f5846259b31edd5bc26497b.png

(2)原因分析

未配置项目文件。

(3)解决方法

①  复制配置文件

d5c619500cc249bd95bebdb84ec3422d.png

② 编辑配置文件并刷新

a61be8e976e648f2a622a83a3365d6ff.png

3f870d59112f47738da1302fcde32bc0.png

③ 再次查看云主机列表,成功

3ed76a55123a4ae98b07de04745e82dc.pngdc094a7e86d74cf2b66129135b907fc0.png

3.nova list 与 virsh list --all有何区别

(1)nova list命令查看云主机

3ed76a55123a4ae98b07de04745e82dc.png

dc094a7e86d74cf2b66129135b907fc0.png

(2)virsh list --all命令查看KVM虚拟机

71e245ca75dd4a61a9110034dda45414.png

3cbc28dac4e24c4582b4c7c8e70daa73.png

①  查看云主机cs_01进程

dd8bc91abc2f4ad28248a06c025af1ff.png75ab6401a87d4e13b703061eb70d502c.png

②查看云主机cs_02进程

115b37fb3a27443db894b356b5bcff97.pngeec0be2a64044b2dadd405d6a5e9dcd0.png

③ 查看配置文件目录

cb0013ab4cc94b18a94e3fbb7c3da51b.pngfe00a46fd6ed4908b2ac778dec219a94.png④ 云主机cs_01 配置文件关键接口信息

c9768fb157f345598f2410fcab1d8b0a.png

⑤云主机cs_02配置文件关键接口信息

b79a1a38620a4b94a2cf27774d62ca75.png

 

4.OpenStack如何查看虚拟路由器

(1)查看网络隔离环境

[root@openstack ~]# ip netns
qdhcp-8b5a5b08-5516-4928-b8b6-8e14476cad0f
qdhcp-0edffd85-3d72-4c82-a73f-01115e32cb4b
qdhcp-3fe9f084-e8f3-4b85-9edb-65db0d4e2679
qdhcp-cd51a8fe-af2e-4e4d-9aaf-4e5874c24eca
qrouter-26af4ac5-5aba-4cb3-bd34-58d1b3701a61

d7751a6d34074beca380b6fe7163d963.png

25aabcada67d48e282b4427e47303167.png

(2) bash命令进入虚拟路由器查看

[root@openstack ~]# ip netns  exec qrouter-26af4ac5-5aba-4cb3-bd34-58d1b3701a61 /bin/bash
[root@openstack ~]# ip add show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host valid_lft forever preferred_lft forever
14: qr-68faaa7e-cc: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN qlen 1000link/ether fa:16:3e:ab:15:c2 brd ff:ff:ff:ff:ff:ffinet 172.25.2.254/24 brd 172.25.2.255 scope global qr-68faaa7e-ccvalid_lft forever preferred_lft foreverinet6 fe80::f816:3eff:feab:15c2/64 scope link valid_lft forever preferred_lft forever
15: qr-df3559a2-e7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN qlen 1000link/ether fa:16:3e:02:a4:00 brd ff:ff:ff:ff:ff:ffinet 172.25.1.254/24 brd 172.25.1.255 scope global qr-df3559a2-e7valid_lft forever preferred_lft foreverinet6 fe80::f816:3eff:fe02:a400/64 scope link valid_lft forever preferred_lft forever
16: qg-ff43c0db-46: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN qlen 1000link/ether fa:16:3e:23:7b:27 brd ff:ff:ff:ff:ff:ffinet 192.168.199.84/24 brd 192.168.199.255 scope global qg-ff43c0db-46valid_lft forever preferred_lft foreverinet 192.168.199.87/32 brd 192.168.199.87 scope global qg-ff43c0db-46valid_lft forever preferred_lft foreverinet 192.168.199.82/32 brd 192.168.199.82 scope global qg-ff43c0db-46valid_lft forever preferred_lft foreverinet6 fe80::f816:3eff:fe23:7b27/64 scope link valid_lft forever preferred_lft forever[root@openstack ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.25.2.254    0.0.0.0         UG    0      0        0 tapc64270af-df
172.25.2.0      0.0.0.0         255.255.255.0   U     0      0        0 tapc64270af-df[root@openstack ~]# exit
exit

 

查看IP信息

5e12dc62403f45aeb06a7015eaa2dc13.png

c08aa15925344ddb9a6aa31a3c767e96.png

查看路由信息

a6ba8f97ce8b41058df8e170484aac8b.png788fd9de98094a419ddc1802a8406e96.png

5.OpenStack如何查看虚拟DHCP服务器

 (1)查看

[root@openstack ~]# ip netns
qdhcp-8b5a5b08-5516-4928-b8b6-8e14476cad0f
qdhcp-0edffd85-3d72-4c82-a73f-01115e32cb4b
qdhcp-3fe9f084-e8f3-4b85-9edb-65db0d4e2679
qdhcp-cd51a8fe-af2e-4e4d-9aaf-4e5874c24eca
qrouter-26af4ac5-5aba-4cb3-bd34-58d1b3701a61

d7751a6d34074beca380b6fe7163d963.png

25aabcada67d48e282b4427e47303167.png

(2) bash命令进入第1个DHCP服务器查看

[root@openstack ~]# ip netns  exec qdhcp-3fe9f084-e8f3-4b85-9edb-65db0d4e2679  /bin/bash[root@openstack ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.199.2   0.0.0.0         UG    0      0        0 tap2d46a37a-12
192.168.199.0   0.0.0.0         255.255.255.0   U     0      0        0 tap2d46a37a-12[root@openstack ~]# ip add show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host valid_lft forever preferred_lft forever
18: tap2d46a37a-12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN qlen 1000link/ether fa:16:3e:bb:04:3c brd ff:ff:ff:ff:ff:ffinet 192.168.199.80/24 brd 192.168.199.255 scope global tap2d46a37a-12valid_lft forever preferred_lft foreverinet6 fe80::f816:3eff:febb:43c/64 scope link valid_lft forever preferred_lft forever[root@openstack ~]# exit
exit

查看路由信息52f3266a625c40c6b16230146a99c603.pngbbf851d69af54d048ce9875cf07c9046.png查看IP信息

2f0bb60e202d4a05948e1268571696b6.png0d02fe31843f4bd1ad49da742870fd17.png

(3) bash命令进入第2个DHCP服务器查看

[root@openstack ~]# ip netns  exec qdhcp-cd51a8fe-af2e-4e4d-9aaf-4e5874c24eca  /bin/bash[root@openstack ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.25.3.0      0.0.0.0         255.255.255.0   U     0      0        0 tap1a095310-18[root@openstack ~]# ip add show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host valid_lft forever preferred_lft forever
19: tapc64270af-df: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN qlen 1000link/ether fa:16:3e:07:89:b5 brd ff:ff:ff:ff:ff:ffinet 172.25.2.101/24 brd 172.25.2.255 scope global tapc64270af-dfvalid_lft forever preferred_lft foreverinet6 fe80::f816:3eff:fe07:89b5/64 scope link valid_lft forever preferred_lft forever[root@openstack ~]# exit
exit

查看路由信息600d69d3d6474edc96f72a61d0bf7675.png

10b81f552c4b46f884c14fde10e01e05.png查看IP信息

2f0bb60e202d4a05948e1268571696b6.png

b19d12d3a3db48a0bdd536019105dbe1.png

(4) bash命令进入第3个DHCP服务器查看

[root@openstack ~]# ip netns  exec qdhcp-8b5a5b08-5516-4928-b8b6-8e14476cad0f  /bin/bash[root@openstack ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.25.1.254    0.0.0.0         UG    0      0        0 tapd441263b-ea
172.25.1.0      0.0.0.0         255.255.255.0   U     0      0        0 tapd441263b-ea[root@openstack ~]# ip add show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host valid_lft forever preferred_lft forever
20: tapd441263b-ea: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN qlen 1000link/ether fa:16:3e:ed:ef:77 brd ff:ff:ff:ff:ff:ffinet 172.25.1.101/24 brd 172.25.1.255 scope global tapd441263b-eavalid_lft forever preferred_lft foreverinet6 fe80::f816:3eff:feed:ef77/64 scope link valid_lft forever preferred_lft forever[root@openstack ~]# exit
exit

查看路由信息aa25e9e8155c4d4bad068818eeecfa40.png

bb166cb1a0694f95a2ff04fca1464bb5.png查看IP信息

bb60877012f54de8a1e48c9ad88a6340.png

460c1e906fe44edbaf8ae1e7e94416c9.png

(5) bash命令进入第4个DHCP服务器查看

[root@openstack ~]# ip netns  exec qdhcp-0edffd85-3d72-4c82-a73f-01115e32cb4b  /bin/bash[root@openstack ~]# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.25.2.254    0.0.0.0         UG    0      0        0 tapc64270af-df
172.25.2.0      0.0.0.0         255.255.255.0   U     0      0        0 tapc64270af-df[root@openstack ~]# ip add show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00inet 127.0.0.1/8 scope host lovalid_lft forever preferred_lft foreverinet6 ::1/128 scope host valid_lft forever preferred_lft forever
19: tapc64270af-df: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UNKNOWN qlen 1000link/ether fa:16:3e:07:89:b5 brd ff:ff:ff:ff:ff:ffinet 172.25.2.101/24 brd 172.25.2.255 scope global tapc64270af-dfvalid_lft forever preferred_lft foreverinet6 fe80::f816:3eff:fe07:89b5/64 scope link valid_lft forever preferred_lft forever[root@openstack ~]# exit
exit

查看路由信息d72d8b700b1347be9d650356f88e6961.pngba1a716f22f541938f45398b1d4776bc.png查看IP信息

2f0bb60e202d4a05948e1268571696b6.png7ab32ec9a167452c9a785eb6bb2e4d5c.png

 


http://www.ppmy.cn/news/1285503.html

相关文章

海德堡UV灯电源维修eta Plus Elc PE22-400-210

uv灯电源维修故障包括&#xff1a; 1、电压不稳&#xff1a;检查uv打印机的电压&#xff0c;设置一个稳压箱即可。 2、温度过高&#xff1a;uv打印机温度过高也会影响uv灯&#xff0c;可以更换为水冷式循环降温。 3、水箱里的信号线接触不好&#xff1a;将两边的信号线对调&…

如果SSE推送不稳定,是不是可以考虑切换成WebSocket,各自有什么优缺点

面对 Server-Sent Events (SSE) 推送不稳定的情况时&#xff0c;可以考虑切换到 WebSocket。SSE 和 WebSocket 都是现代Web应用中用于实现实时通信的技术&#xff0c;但它们有各自的优缺点和最适用的场景。 Server-Sent Events (SSE) 优点 简单性&#xff1a;SSE 在使用上比…

【Linux】Ubuntu22.04版本下实现gcc版本的快速切换

本文将介绍如何在Ubuntu22.04版本下实现gcc版本的快速切换。 本文首发于 ❄️慕雪的寒舍 前言 有的时候&#xff0c;不同版本的gcc会造成一些细微的差异&#xff0c;导致相关的一些工具不兼容&#xff0c;比如用于单元测试覆盖率生成的gcov/lcov工具&#xff0c;在不同的gcc版…

基于电商场景的高并发RocketMQ实战-Broker写入读取流程性能优化总结、Broker基于Pull模式的主从复制原理

&#x1f308;&#x1f308;&#x1f308;&#x1f308;&#x1f308;&#x1f308;&#x1f308;&#x1f308; 【11来了】文章导读地址&#xff1a;点击查看文章导读&#xff01; &#x1f341;&#x1f341;&#x1f341;&#x1f341;&#x1f341;&#x1f341;&#x1f3…

Java虚拟机中的垃圾回收

2 垃圾回收 2.1 判断一个对象是否可回收 2.1.1 引用计数法 如果一个对象被另一个对象引用&#xff0c;那么它的引用计数加一&#xff0c;如果那个对象不再引用它了&#xff0c;那么引用计数减一。当引用计数为 0 时&#xff0c;该对象就应该被垃圾回收了。 但是下面这种互相…

HarmonyOS page生命周期函数讲解

下面 我们又要看一个比较重要的点了 页面生命周期 页面组件有三个生命周期 onPageShow 页面显示时触发 onPageHide 页面隐藏时触发 onBackPress 页面返回时触发 这里 我们准备两个组件 首先是 index.ets 参考代码如下 import router from ohos.router Entry Component struc…

从方程到预测:数学在深度学习中的作用

图片来源 一、说明 深度学习通常被认为是人工智能的巅峰之作&#xff0c;它的成功很大程度上归功于数学&#xff0c;尤其是线性代数和微积分。本文将探讨深度学习与数学之间的深刻联系&#xff0c;阐明为什么数学概念是该领域的核心。 二、数学框架 从本质上讲&#xff0c;深度…

python+django网上购物商城系统o9m4k

语言&#xff1a;Python 框架&#xff1a;django/flask可以定制 软件版本&#xff1a;python3.7.7 数据库&#xff1a;mysql 数据库工具&#xff1a;Navicat 开发工具pycharm/vscode都可以 前端框架:vue.js 系统使用过程主要涉及到管理员和用户两种角色&#xff0c;主要包含个…