ddlient 返回 127.0.0.1 而不是外部 IP

ddlient 返回 127.0.0.1 而不是外部 IP

我在多台机器上使用 ddclient 没有任何问题(Ubuntu 12.04 和 14.04),但有一台机器随机返回 127.0.0.1

我对所有机器使用相同的配置(当然主机名除外)

# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf

protocol=dyndns2
use=web, web=checkip.dyndns.com, web-skip='IP Address'
server=members.dyndns.org
login=***
password='***'
something.dyndns.org

我怀疑网络配置出了问题,但由于我不负责网络,负责的人也帮不上忙,所以我只能试着从我的角度来解决这个问题。

以下行来自帮助部分:

  -if-skip pattern      : skip any IP addresses before 'pattern' in the output of ifconfig {if}.

似乎告诉我我可以跳过某些地址,但我不明白如何使用它,以及我已经使用的“web-skip”命令是做什么用的。

执行“ddclient -daemon=0 -query”返回以下内容:

use=if, if=br0 address is 192.168.12.3
use=if, if=eth0 address is NOT FOUND
use=if, if=eth1 address is NOT FOUND
use=if, if=eth2 address is NOT FOUND
use=if, if=eth3 address is NOT FOUND
use=if, if=lo address is 127.0.0.1
use=web, web=dnspark address is <correct external ip>
use=web, web=dyndns address is <correct external ip>
use=web, web=loopia address is <correct external ip>

尽管我想要的是网址,但 ddclient 是否会因为某种原因返回“lo”地址?如果 ddclient 认为它是 127.0.0.1,有没有办法不发送地址更新?

答案1

现在看看是谁问了这个问题。嗨,Pit!

据我所知,您不需要获取任何本地接口,只需要基于 webservice 的接口。我还剩下一项使用 dyndns.org 的服务(其余的我都迁移到了我自己的平台上),我的情况也类似。但是 web-skip 是空的。(它也运行在 OpenBSD 上,版本稍旧一些)

这是我看到的唯一显著差异。这是我的配置(当然,正如我所说,在 OpenBSD 上运行)

# grep -v ^# ddclient.conf | grep -v ^$
daemon=300                              # check every 300 seconds
syslog=yes                              # log update msgs to syslog
mail=root                               # mail all msgs to root
mail-failure=root                       # mail failed update msgs to root
pid=/var/run/ddclient.pid               # record PID in file.
ssl=no                                  # use ssl-support.  Works with
                                        # ssl-library
                                        # new IP is added as argument.
use=web,                                \
web=ip.myownplatform.lu,                \
web-skip=''
login=user                              # default login
password=secret                         # default password
custom=yes,                             \
server=members.dyndns.org,              \
protocol=dyndns2                        \
jawtheshark.com

如您所见,其他大多数更改都无关紧要。我看到的唯一真正区别是 web-skip=''

也许可以尝试一下?

相关内容