|
|
首先通过界面或者底层port 创建方式创建三个port端口:) h! v; q+ G. l$ Q9 y
$ [- K* }5 g- v: _8 y# T
$ R# y& r5 |5 v" h( g1 d; I
[root@controller1 ~]# openstack port list |grep -e 192.168.0.230 -e 192.168.0.186 -e 192.168.0.187; N3 ?- t9 U: I! I5 ?+ i2 a
| 135bba9e-c0d9-4849-bacb-e202c25a89bf | | fa:16:3e:4d:e2:cc | ip_address='192.168.0.230', subnet_id='184a0f51-8db4-4bc7-8240-ca5e37367208' | DOWN |
- B3 n/ \/ E! |3 K/ D2 ?9 Z0 I& K; }| 5208ea41-d73a-4408-8559-b4aee18dc54e | | fa:16:3e:47:b8:72 | ip_address='192.168.0.187', subnet_id='184a0f51-8db4-4bc7-8240-ca5e37367208' | DOWN |
4 j& Z0 B& G$ f. A4 U; X| b42538c2-7583-443e-9779-8a09a4204495 | | fa:16:3e:fc:59:73 | ip_address='192.168.0.186', subnet_id='184a0f51-8db4-4bc7-8240-ca5e37367208' | DOWN |* L4 M# u2 o/ [# q; D
4 J2 N; t7 [- V X
4 L0 g" }# t4 c9 b E6 U t使用命令或者界面把vip地址写到两个需要启动vip地址的端口上:9 M* x& p$ Y3 A, I) ~* w' A
[root@controller1 ~]# openstack port set b42538c2-7583-443e-9779-8a09a4204495 --allowed-address ip-address=192.168.0.230# Y' W6 l; k# R3 M4 h
1 a- a% l @9 B& M `
[root@controller1 ~]# openstack port show 5208ea41-d73a-4408-8559-b4aee18dc54e4 Z0 r* K6 E) @4 W; s: } z
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
# G/ Z ~# ?, L$ w| Field | Value |$ G2 Z8 V& Z( W, z! N" q4 P' q7 @0 S
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
7 S5 C j/ ^4 D4 w7 K/ P| admin_state_up | UP |; g' W5 N# T1 a. q6 H" L
| allowed_address_pairs | ip_address='192.168.0.230', mac_address='fa:16:3e:47:b8:72' |9 E. }1 A( G3 A b
| binding_host_id | |
?5 ?! E# K* V| binding_profile | |; `* l2 M0 P( z" t, \- @8 v
| binding_vif_details | |
6 s- X; ~ N1 g9 x b- q| binding_vif_type | unbound |3 b# w4 o3 E8 l3 I& Z4 \
| binding_vnic_type | normal |$ }0 f! g8 M; ], m+ e2 I' H
| created_at | 2021-12-07T01:51:14Z |- E; d# P9 A& L% Z9 T. W
| data_plane_status | None |
9 @# h7 O2 j6 F& ^; t3 Y| description | | s+ N" j2 x+ M) ^ K
| device_id | |
8 f# c$ s; x u6 C0 w* [| device_owner | |3 c C, p6 {% |* r) x4 o
| dns_assignment | None |* {" z d" w+ J, M
| dns_domain | None |
5 v) [: M4 Y* \| dns_name | None |5 G( x% m2 {8 F1 y
| extra_dhcp_opts | |
8 f$ k* I# D1 f9 R, e, H| fixed_ips | ip_address='192.168.0.187', subnet_id='184a0f51-8db4-4bc7-8240-ca5e37367208' |
& |; t, P0 N; }4 A| id | 5208ea41-d73a-4408-8559-b4aee18dc54e |9 ^: t! e6 m! g3 R
| ip_allocation | None |. m, O7 o) C# F9 G5 L$ z
| location | cloud='', project.domain_id=, project.domain_name='Default', project.id='ce0a7c083cf3482baaf5c9a88a1407ff', project.name='admin', region_name='RegionOne', zone= |
/ L9 O6 S% D7 B9 v8 C| mac_address | fa:16:3e:47:b8:72 |
5 L# H- q! e( ]4 j| name | |
1 h- p' ]9 g% W0 o8 v| network_id | 371dfca6-bc51-470b-a762-bec6af8af048 |
. h: }' f0 {( M| port_security_enabled | True | @8 R. C0 ?3 O2 J7 M1 X* v
| project_id | ce0a7c083cf3482baaf5c9a88a1407ff |
" v" M' w! O( n" u4 J, g| propagate_uplink_status | None | X5 a. {5 N$ V- F
| qos_network_policy_id | None |
+ {8 }/ H) U) N/ X| qos_policy_id | None |
Y$ g6 O6 N% s; b. \2 x4 z: D| resource_request | None |
% Y8 _+ F, |/ q# V) {* m0 ` J3 Q| revision_number | 18 |
+ C3 m, h& I! ]8 Y( S: p* Q| security_group_ids | |
- Y* [$ X; [$ Z| status | DOWN |
% e; Y+ W) c5 p| tags | |: i7 u" m4 e. H, f
| trunk_details | None |; e; D X( _- p& w1 ?/ w7 J$ Q. m
| updated_at | 2021-12-07T02:02:15Z |
- A, B6 K) e8 J% w+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+. q4 a0 |+ z& S
[root@controller1 ~]# openstack port show b42538c2-7583-443e-9779-8a09a4204495
% `: z" J4 p4 q6 ^8 a+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+. v! p. N e; g* _
| Field | Value |
5 q" j. `$ {7 A; e i2 u. ^+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+9 d; }) b; d7 E" U, c& C3 M
| admin_state_up | UP |$ U9 ]4 A5 D; O
| allowed_address_pairs | ip_address='192.168.0.230', mac_address='fa:16:3e:fc:59:73' |
9 D* M- M, _7 u| binding_host_id | |
, ^" {5 T# A$ F; ^| binding_profile | |; y' |% E M. z! E' T
| binding_vif_details | |, B# y$ f t# I- ^; j4 i4 v( i8 j
| binding_vif_type | unbound | d3 M y, Q% c7 U
| binding_vnic_type | normal |
5 w5 A {7 Z3 p" Q3 I8 {| created_at | 2021-12-07T01:50:50Z |
' }) c8 r! A# z| data_plane_status | None |" w5 x y3 W0 A2 ]# P* y. i5 C
| description | |. [, o, R* I* g0 F: s
| device_id | |
- n# d# l8 u7 w' \* Y( r& y9 k9 C+ D| device_owner | |
9 a' u2 i+ p8 y0 I7 j* H| dns_assignment | None |
# e6 @2 D; b: w' N& Q: s7 I| dns_domain | None |1 C, B, V; r1 W, h# N
| dns_name | None |
* Y' x p' ]8 n: L% s) v+ p$ v| extra_dhcp_opts | |
( ?, K5 N b$ N( v| fixed_ips | ip_address='192.168.0.186', subnet_id='184a0f51-8db4-4bc7-8240-ca5e37367208' |
; {4 y, Y" O( ?& x% {' c z: U4 X| id | b42538c2-7583-443e-9779-8a09a4204495 |; V: ?/ \8 X# s" ^" i
| ip_allocation | None |
# ]4 I. E ~, Y# N7 o! C$ s; {4 j+ `| location | cloud='', project.domain_id=, project.domain_name='Default', project.id='ce0a7c083cf3482baaf5c9a88a1407ff', project.name='admin', region_name='RegionOne', zone= |( ~5 |6 j) Z& o
| mac_address | fa:16:3e:fc:59:73 |6 v/ ~* s! ^1 o8 L7 `
| name | |
( V& _4 r$ D+ p/ H| network_id | 371dfca6-bc51-470b-a762-bec6af8af048 |
7 W' J. k" |" X. Z| port_security_enabled | True |
" Z0 c8 ]2 @" y; k| project_id | ce0a7c083cf3482baaf5c9a88a1407ff |4 H1 a U7 d' |5 @' M
| propagate_uplink_status | None |% B! ~6 N9 p: w, }
| qos_network_policy_id | None |
) U _7 ~' u! ~8 t& ^' t" t4 K| qos_policy_id | None |
( V! v& Q, M N2 C! r+ a' N| resource_request | None |- D; m) [. S" |3 u j
| revision_number | 9 |$ c5 M7 Y4 j: h% _' `
| security_group_ids | |
( }9 T/ V2 _7 h. E& S| status | DOWN |5 H" N/ D: J+ t9 r+ S! g3 F, g$ l
| tags | |
& b- J3 y2 i( X| trunk_details | None |
8 H) w7 E1 W0 z' E/ H4 T| updated_at | 2021-12-07T02:03:01Z |& x, ?5 p" N5 B7 P' u" M
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
, p6 T8 Q/ ]# a! ~4 r
! Y0 D' D1 j4 M# x. s, r% {' q0 y[root@controller1 ~]# openstack port show 135bba9e-c0d9-4849-bacb-e202c25a89bf
- Z e* W9 |1 A9 ?+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
; Z; Z7 j9 V& u* _! J+ h| Field | Value |. l' ^! `' V7 N: \% m; v! f R
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
7 W& J5 ~: X2 f: M" r! Q| admin_state_up | UP | Q) C$ U8 j* M# i! D
| allowed_address_pairs | |/ s2 {, r; T |
| binding_host_id | |
$ J, t) M! W4 y2 j! R| binding_profile | |
1 s- K2 C9 Z) }- ~% ?+ p| binding_vif_details | |7 R; H; J5 \4 o
| binding_vif_type | unbound |' F; P. n0 j3 T
| binding_vnic_type | normal |
. q0 r$ I6 Q" W6 |$ b| created_at | 2021-12-07T01:06:08Z |
6 ^* p0 r! K/ K* C T| data_plane_status | None |- L! T t V9 t! R1 b2 Z
| description | |
4 _; }3 R4 t, u- v| device_id | |
4 I' t4 _! O# k t5 W: i8 t| device_owner | |
! [- m8 H4 X3 Y# M+ s4 r6 A" v| dns_assignment | None |
1 f5 Z0 B8 ~2 h7 ^| dns_domain | None |% F& q$ p6 ~" R2 t
| dns_name | None |
$ x3 l7 y5 j1 ]6 R| extra_dhcp_opts | |! z, O# N+ Z% \3 e6 o' K( [' e
| fixed_ips | ip_address='192.168.0.230', subnet_id='184a0f51-8db4-4bc7-8240-ca5e37367208' |
# |* y7 u0 E* C% |# |# y$ {. d u| id | 135bba9e-c0d9-4849-bacb-e202c25a89bf |
3 b% a& o1 k& m' H0 r) g3 g| ip_allocation | None |: a& E9 L- x/ Z( G: Y( M$ N
| location | cloud='', project.domain_id=, project.domain_name='Default', project.id='ce0a7c083cf3482baaf5c9a88a1407ff', project.name='admin', region_name='RegionOne', zone= |! }2 R$ J3 M: r" S4 {2 M
| mac_address | fa:16:3e:4d:e2:cc |. k6 M( E: P4 d7 w. E
| name | |
# u6 b- ? W7 g( l, g| network_id | 371dfca6-bc51-470b-a762-bec6af8af048 |
7 N7 _7 \7 U5 S6 B3 S; t/ H8 s+ X| port_security_enabled | True |
+ y/ l/ \$ S- b| project_id | ce0a7c083cf3482baaf5c9a88a1407ff |
' m2 Q- f4 X4 B2 q0 s5 X| propagate_uplink_status | None |" t0 D4 b6 M' H2 d* G* O% R
| qos_network_policy_id | None |: X" o' d n( K- N7 ~- S
| qos_policy_id | None |
' O! {; a! A' Y3 [: \| resource_request | None |
. J2 x$ r* q# L C( H| revision_number | 12 |
' l9 ?' [9 {! [| security_group_ids | |! V3 S% H- o5 Y- v
| status | DOWN |
& `2 q* Y% @5 @| tags | |
5 _- ~* x$ J, u0 e% ^- F" _| trunk_details | None |
# r1 G6 c, J) A l4 S- ~: b| updated_at | 2021-12-07T02:00:32Z |" ^- g6 b1 R3 z5 F- c
+-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
4 p' t5 I- }/ C5 I. W
& D. U* {1 P2 T. z[: f+ l! |5 ~! T' ?
[root@controller1 ~]# openstack port set 135bba9e-c0d9-4849-bacb-e202c25a89bf --disable-port-security 0 L$ p' n4 V3 ^1 X; h E% K* h' t5 B U5 K
6 A0 [. M7 b0 c* y* O9 P: }
0 {7 k6 q! r9 { M/ B" y; l, C) Z5 l! I6 J# D, @6 p0 U: n6 |( n( `
这样保证openstack平台上port能被占用,而且不被其他租户创建。7 f6 R- P' D% M: }
- H+ [$ _( M( d4 _
删除地址对:& `" \8 U2 u, o/ F8 w, P+ Y% q
[root@controller1 ~]# openstack port set b42538c2-7583-443e-9779-8a09a4204495 --no-allowed-address
$ ^4 ` A. Q6 a8 U0 i
" w- K/ G @* |. {& M# ^% Z# g: O( W# t U1 I( `# k& r
|
|