易陆发现互联网技术论坛

 找回密码
 开始注册
查看: 732|回复: 0
收起左侧

openstack 上云主机因创建后,路由未发生变化,只获取了ovs上的网关导致无法通外网

[复制链接]
发表于 2022-7-29 17:01:21 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?开始注册

x
[root@ocp-k8s-test2 ~]# route -n
+ i+ N$ z( H2 B" W* _4 ~4 ?Kernel IP routing table
' e4 ^& n: y1 k2 m6 PDestination     Gateway         Genmask         Flags Metric Ref    Use Iface: v  p; i! a+ m5 Y5 K% f! H' n
169.254.169.254 192.168.101.65  255.255.255.255 UGH   0      0        0 eth0- E6 m# n; {; V  x: \, h
192.168.100.0   0.0.0.0         255.255.255.224 U     0      0        0 eth0
$ m/ w+ y- |+ j! H: }/ l! u0 o192.168.100.32  0.0.0.0         255.255.255.224 U     0      0        0 eth07 q9 g/ \/ U& a2 \# b: {, w/ n4 J& ^
192.168.100.64  0.0.0.0         255.255.255.224 U     0      0        0 eth0
5 @. X# M$ L; Y8 X' A192.168.100.96  0.0.0.0         255.255.255.224 U     0      0        0 eth05 L( Q5 E* T( o( u$ Y) L
192.168.100.128 0.0.0.0         255.255.255.224 U     0      0        0 eth0
) |' n. |  o2 c7 ~: C+ H4 v  k192.168.100.160 0.0.0.0         255.255.255.224 U     0      0        0 eth02 |! W: O" o" l/ P- H) B
192.168.100.192 0.0.0.0         255.255.255.224 U     0      0        0 eth0: C  c' x! {9 ?. l$ I7 t; ], [7 Y
192.168.100.224 0.0.0.0         255.255.255.224 U     0      0        0 eth0
( B$ x% ?& W& d: ~192.168.101.0   0.0.0.0         255.255.255.224 U     0      0        0 eth0
; w; R  v  O3 x* |% {/ X, b192.168.101.64  0.0.0.0         255.255.255.224 U     0      0        0 eth0' S* s3 e! Q1 K3 J
[root@ocp-k8s-test2 ~]# ping www.baidu.com# ^$ Q0 V; U  C1 d7 h* e9 g% @( x
ping: www.baidu.com: Name or service not known9 r9 m2 K5 V6 n! \( o2 D& T
[root@ocp-k8s-test2 ~]# ping 192.168.0.1' B4 A7 \7 I2 ]- C1 f3 A6 a/ ~
connect: Network is unreachable
! y. b. X" W5 k" O' O[root@ocp-k8s-test2 ~]# ip addr, i1 F0 q( @* [$ B. s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
* F' T- a4 K& `. _3 F; E    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00) Y$ E. {  g' D1 Y( U; x
    inet 127.0.0.1/8 scope host lo/ K2 W# w3 C7 x2 y+ Y7 Q
       valid_lft forever preferred_lft forever- u4 C9 C2 z/ ]. u, }5 t, d: A
    inet6 ::1/128 scope host
! K( F8 Y5 G2 y9 K  Q       valid_lft forever preferred_lft forever3 J5 _0 d8 ~' x" {; _; ?7 F$ Y+ L
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 10000 u! ~7 @' h- N5 ]+ O0 j. s+ R
    link/ether fa:16:3e:50:eb:dc brd ff:ff:ff:ff:ff:ff( r# u8 L/ b9 G3 ~$ f
    inet 192.168.101.67/27 brd 192.168.101.95 scope global eth0
6 N5 g/ W1 a: n, c, z       valid_lft forever preferred_lft forever
0 g+ ~& C: {* Q- d+ x& ?$ Z    inet6 fe80::f816:3eff:fe50:ebdc/64 scope link
2 Q9 S! ?- h3 O6 }- `0 A- Q       valid_lft forever preferred_lft forever
! N5 C5 K, j5 M! Z( E4 E# B9 q
" r7 V& o, P. T如果我们重启网络服务:
7 K7 A; v! b! o9 y! p- ?systemctl restart network.service! d3 w% T6 Q9 Q
之后
- @9 f9 h) o$ V6 J( s3 q
0 T3 N; l$ F: u/ z[root@ocp-k8s-test2 ~]# systemctl restart network.service & m; U9 U: c2 p, s2 R4 |: s$ {
[root@ocp-k8s-test2 ~]#
( B  J+ F6 V! |! j* h; d8 H6 T4 N. Q4 I
路由发生变化:0 y6 D, V( G4 K8 f
[root@ocp-k8s-test2 ~]# route -n
4 _8 J) N1 u  Z- d3 K' jKernel IP routing table; z8 V6 ?6 u- d+ i# e+ o& J7 [
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
7 n' {3 B! m* @. {0.0.0.0         192.168.100.1   0.0.0.0         UG    100    0        0 eth0
/ t; D5 U4 a8 f+ U169.254.169.254 192.168.101.65  255.255.255.255 UGH   100    0        0 eth0) X, i- F9 u- P# a
192.168.100.0   0.0.0.0         255.255.255.224 U     100    0        0 eth0
3 V/ M+ s, Y6 u! H9 B4 w192.168.100.32  0.0.0.0         255.255.255.224 U     100    0        0 eth0
/ o' B% w& M, P( w192.168.100.64  0.0.0.0         255.255.255.224 U     100    0        0 eth0
3 E' x% |4 m! [' O; q5 V192.168.100.96  0.0.0.0         255.255.255.224 U     100    0        0 eth08 F$ n% S( @* g# g. D: q2 F
192.168.100.128 0.0.0.0         255.255.255.224 U     100    0        0 eth0
/ h) S; Q3 C% b3 k192.168.100.160 0.0.0.0         255.255.255.224 U     100    0        0 eth0) k8 F! `( v9 D
192.168.100.192 0.0.0.0         255.255.255.224 U     100    0        0 eth0
+ r( k' Q! Q1 b! ]192.168.100.224 0.0.0.0         255.255.255.224 U     100    0        0 eth0
3 n+ ^( S/ V, G192.168.101.0   0.0.0.0         255.255.255.224 U     100    0        0 eth0+ M& a1 p+ V1 `
192.168.101.64  0.0.0.0         255.255.255.224 U     100    0        0 eth0' K- }9 `: k7 z4 P* F) V, V
此时增加了,192.168.100.1的路由网络。
( h1 D: T' n7 t0 ^, m7 k
, ^: G6 o5 q" h3 u7 h4 vping 外网可以通了,: a8 }. }- E7 {! p
[root@ocp-k8s-test2 ~]# ping www.baidu.com
9 i; Z! x. J' m. {# y9 e, zPING www.a.shifen.com (220.181.38.150) 56(84) bytes of data.3 K! r9 K+ Y1 ~6 l7 C# r
64 bytes from 220.181.38.150 (220.181.38.150): icmp_seq=1 ttl=53 time=4.32 ms
. z1 X# @) e% a4 Z' `^C
! ]& ?# J: c  |7 F0 d--- www.a.shifen.com ping statistics ---
) u! z' Z1 M9 n) h: f1 packets transmitted, 1 received, 0% packet loss, time 0ms2 q/ {: n3 g+ w8 z6 O8 ?: _
rtt min/avg/max/mdev = 4.328/4.328/4.328/0.000 ms
. E/ j6 F9 W5 |8 A$ ~  S$ A! M[root@ocp-k8s-test2 ~]# ping 192.168.0.1
2 o0 X7 b: ?8 u! cPING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.
  x/ k. g  r' l! k! s64 bytes from 192.168.0.1: icmp_seq=1 ttl=254 time=0.239 ms. C. s; B# i% i7 e* |" b
^C- {$ Q5 z. k, n/ F, F
--- 192.168.0.1 ping statistics ---
5 e- q2 o$ _/ D1 packets transmitted, 1 received, 0% packet loss, time 0ms
3 w& r3 g# i0 p! s4 m- Ertt min/avg/max/mdev = 0.239/0.239/0.239/0.000 ms
. i% z+ g6 r  A* }& e# t1 E% s8 d% p[root@ocp-k8s-test2 ~]#
9 Y- e! g* @- |. E' A& w8 ]3 f) Q
7 s7 |: A, i/ r, b- u( N0 E1 @/ X
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

北京云银创陇科技有限公司以云计算运维,代码开发

QQ|返回首页|Archiver|小黑屋|易陆发现技术论坛 点击这里给我发消息

GMT+8, 2026-4-8 15:28 , Processed in 0.039650 second(s), 22 queries .

Powered by Discuz! X3.4 Licensed

© 2012-2025 Discuz! Team.

快速回复 返回顶部 返回列表