Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多 IP 问题 #49

Open
ghost opened this issue Sep 7, 2016 · 0 comments
Open

多 IP 问题 #49

ghost opened this issue Sep 7, 2016 · 0 comments

Comments

@ghost
Copy link

ghost commented Sep 7, 2016

在同一个网卡配置 2 个 IP:

# ip addr show em1
2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:a1:70:38 brd ff:ff:ff:ff:ff:ff
    inet 192.168.190.129/24 brd 192.168.190.255 scope global em1
       valid_lft forever preferred_lft forever
    inet 192.168.190.130/24 brd 192.168.190.255 scope global secondary em1:0
       valid_lft forever preferred_lft forever

当使用第二个 IP 来 dig @192.168.190.130 copybash.com,dig 失败,原因是请求从第一个 IP 返回来了,dig 认为这是欺骗行为:

;; reply from unexpected source: 192.168.190.129#53, expected 192.168.190.130#53
;; reply from unexpected source: 192.168.190.129#53, expected 192.168.190.130#53
;; reply from unexpected source: 192.168.190.129#53, expected 192.168.190.130#53

; <<>> DiG 9.9.4-RedHat-9.9.4-29.el7 <<>> @192.168.190.130 copybash.com
; (1 server found)
;; global options: +cmd
;; connection timed out; no servers could be reached

基于这样的原因,keepalive + LVS 的 VIP 无法正常提供域名解析服务。一个不够友好的解决方式就是在 /etc/resolv.conf 里面写多个 dnspod-sr 的 IP 作为 nameserver,来实现高可用。

@ghost ghost closed this as completed Sep 8, 2016
@ghost ghost reopened this Sep 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants