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

目录

一、实验

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.hqwc.cn/news/308050.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

cdn引入React以及React-dom—数组遍历渲染时setExtraStackFrame报错

在引入react官网提供的cdn后&#xff0c;部分静态页面没有问题&#xff0c;但是使用到 一下循环的页面则会报错。 const devReactCdn [https://unpkg.com/react18/umd/react.development.js,https://unpkg.com/react-dom18/umd/react-dom.development.js, ]; const prodReact…

鸿蒙原生应用再添新丁!爱奇艺入局鸿蒙

鸿蒙原生应用再添新丁&#xff01;爱奇艺 入局鸿蒙 来自 HarmonyOS 微博12月29日消息&#xff0c;#爱奇艺完成鸿蒙原生应用Beta版#作为中国头部在线视频平台&#xff0c;爱奇艺 完成鸿蒙原生应用Beta版&#xff0c;将以丰富的正版高清视频资源促进鸿蒙生态的进一步繁荣&#x…

普中STM32-PZ6806L开发板(HAL库函数实现-无源蜂鸣器响动)

简介 本篇将驱动无源蜂鸣器进行5KHz的响动。电路原理图 蜂鸣器电路原理图 主芯片驱动引脚原理图 其他知识 蜂鸣器类型 蜂鸣器分为 有源蜂鸣器 &#xff1a;触发就会响。 无源蜂鸣器 : 需要给源, 输出一定频率的音频信号&#xff0c; 震动发声; 占空比 为什么占空比总是5…

【重磅新品】小眼睛科技推出紫光同创盘古系列FPGA开发板套件,盘古200K开发板,紫光同创PG2L200H,Logos2系列

FPGA&#xff0c;即现场可编程门阵列&#xff0c;作为可重构电路芯片&#xff0c;已经成为行业“万能芯片”&#xff0c;在通信系统、数字信息处理、视频图像处理、高速接口设计等方面都有不俗的表现。近几年&#xff0c;随着国家战略支持和产业发展&#xff0c;国产FPGA迎来迅…

共享单车之数据分析

文章目录 第1关&#xff1a;统计共享单车每天的平均使用时间第2关&#xff1a;统计共享单车在指定地点的每天平均次数第3关&#xff1a;统计共享单车指定车辆每次使用的空闲平均时间第4关&#xff1a;统计指定时间共享单车使用次数第5关&#xff1a;统计共享单车线路流量 第1关…

GLTF编辑器-位移贴图实现破碎的路面

在线工具推荐&#xff1a; 3D数字孪生场景编辑器 - GLTF/GLB材质纹理编辑器 - 3D模型在线转换 - Three.js AI自动纹理开发包 - YOLO 虚幻合成数据生成器 - 三维模型预览图生成器 - 3D模型语义搜索引擎 位移贴图是一种可以用于增加模型细节和形状的贴图。它能够在渲染时针…

【无标题】《巴黎图书馆》,又发现一本书

我喜愛看的书(https://img-blog.csdnimg.cn/8cd84d33e6724f09a46831f75abe6464.jpg)在这里插入图片描述

帆软FineBi V6版本经验总结

帆软FineBi V6版本经验总结 BI分析出现背景 ​ 现在是一个大数据的时代&#xff0c;每时每刻都有海量的明细数据出现。这时大数据时代用户思维是&#xff1a;1、数据的爆炸式增长&#xff0c;人们比起明细数据&#xff0c;更在意样本的整体特征、相互关系。2、基于明细的“小…

详解C语言单链表接口函数

准备工作 创建一个头文件&#xff08;SList.h&#xff09;,两个源文件&#xff08;SList.c和test.c&#xff09; SList.h:用于包含库函数的头文件&#xff0c;链表节点结构体声明&#xff0c;接口函数的声明等【另外两个源文件要包含SList.h这个头文件&#xff0c;才能使用其…

《HelloGitHub》第 93 期

兴趣是最好的老师&#xff0c;HelloGitHub 让你对编程感兴趣&#xff01; 简介 HelloGitHub 分享 GitHub 上有趣、入门级的开源项目。 这里有实战项目、入门教程、黑科技、开源书籍、大厂开源项目等&#xff0c;涵盖多种编程语言 Python、Java、Go、C/C、Swift...让你在短时间内…

Selenium在vue框架下求生存

vue框架下面&#xff0c;没有id、没有name&#xff0c;vue帮开发做了很多脏活累活&#xff0c;却委屈了写页面自动化测试的人&#xff08;当然&#xff0c;也给爬信息的也带来了一定的难处&#xff09;。这里只能靠总结&#xff0c;用一些歪门邪道&#xff1a; 一、跟开发商量…

字符串转换tuple对象

给定“前导空格分隔的元组字符串”&#xff0c;还原成合法的python元组tuple对象。 (笔记模板由python脚本于2023年12月29日 19:29:03创建&#xff0c;本篇笔记适合熟悉Python元组tuple的coder翻阅) 【学习的细节是欢悦的历程】 Python 官网&#xff1a;https://www.python.org…