又一个dubbo多网卡问题

背景

d29eb3f0f289ea5f646edf04479a50e1011.jpg

又是一起无法访问的事件

分析

首先参考这类问题 错误解决 Forbid consumer XXX access service YYY from registry ZZZ use dubbo version 2.5.3, Please check registry access list (whitelist/blacklist).

发现其实不是一回事~

从上文中报错可以得知发现一个异常的ip【192.168.122.1】

而我们的ip是12/13网段 那么这个122网段哪里来的呢???

Interesting

还记得前几天写的关于多网卡的环境 dubbo多网卡

我们考虑是否网络环境发生了变化

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
ifconfig
enp0s29u1u1u5: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.95.120 netmask 255.255.255.0 broadcast 169.254.95.255
inet6 fe80::40f2:e9ff:fed5:1704 prefixlen 64 scopeid 0x20<link>
ether 42:f2:e9:d5:17:04 txqueuelen 1000 (Ethernet)
RX packets 4520292 bytes 357928180 (341.3 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4302246 bytes 412991075 (393.8 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp11s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.13.128 netmask 255.255.255.0 broadcast 192.168.13.255
inet6 fe80::9123:a7e2:7f1f:5f12 prefixlen 64 scopeid 0x20<link>
ether 40:f2:e9:d5:17:02 txqueuelen 1000 (Ethernet)
RX packets 1401038615 bytes 1284272900666 (1.1 TiB)
RX errors 0 dropped 94542 overruns 0 frame 0
TX packets 1167969749 bytes 643782468645 (599.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 18 memory 0xc1a80000-c1aa0000
enp6s0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 40:f2:e9:d5:17:01 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 17 memory 0xc1b80000-c1ba0000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 6793920 bytes 32362453500 (30.1 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 6793920 bytes 32362453500 (30.1 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:00:38:71 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

一个异常的virbr0出现了【话说enp0s29u1u1u5也蛮异常 一般不是应该eth0?】

刚好virbr0的ip为192.168.122.1 因此我们可以判断出来极大的可能性由于走错了网关导致。

那么virbr0是个什么鬼?

在centos7.3里安装 Xen 或安装 KVM 后,会发现网络接口里多了一个叫做 virbr0 的虚拟网络接口,并且会自动获得一个私有地址。

image2018-6-14_2013_3A15_3A48.png_version_1_modificationDate_1528953853000_api_v2

这是由于安装和启用了 libvirt 服务后生成的,libvirt 在服务器host上生成一个 virtual network switch (virbr0),host 上所有的虚拟机(guests)通过这个 virbr0 连起来。默认情况下 virbr0 使用的是 NAT 模式(采用 IP Masquerade),所以这种情况下 guest 通过 host 才能访问外部。

解决

那我们关闭这块网卡吧

1
2
ifconfig virbr0 down
brctl delbr virbr0

一切OK!