IP获取错误
qingmo opened this issue · 6 comments
qingmo commented
V2ray一键脚本,运行之前请确认如下条件已经具备:
- 一个伪装域名
- 伪装域名DNS解析指向当前服务器ip()
- 如果/root目录下有 v2ray.pem 和 v2ray.key 证书密钥文件,无需理会条件2
这里可以看到提示的第二行没有正确获取到ip地址。
鉴于目前大多数都是用的直通vps,可以考虑直接使用ip指令获取对应的ip地址。
hijkpw commented
没有获取到ip地址的原因:服务器有多个ip,或者在内网。
不清楚你说的直通vps什么意思,但ip指令无法在阿里云等大厂服务器上获取外部ip。
Sent from ProtonMail for iOS
在 周三, 4月 28, 2021 在 10:04, qingmo ***@***.***> 来信:
… V2ray一键脚本,运行之前请确认如下条件已经具备:
- 一个伪装域名
- 伪装域名DNS解析指向当前服务器ip()
- 如果/root目录下有 v2ray.pem 和 v2ray.key 证书密钥文件,无需理会条件2
这里可以看到提示的第二行没有正确获取到ip地址。
鉴于目前大多数都是用的直通vps,可以考虑直接使用ip指令获取对应的ip地址。
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, [view it on GitHub](#19), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AN72N6K3K4OOEU5FXAUY6DTTK5UKZANCNFSM43WDRY7A).
qingmo commented
那我找一下其他替代的方案,我觉得单靠一个ip.sb不够稳定啊,至少我这边的vps上没有成功获取到,实际上我用
ip address |grep inet | grep -v inet6 | grep -v "127.0.0.1" |awk -F' ' '{print $2}' | awk -F/ '{print $1}' | head -n 1
可以获取到对应的ip。当然,考虑通用方案,我会找一个比较稳定的ip接口
hijkpw commented
正常来说,除非你有多个ip,否则ip.sb反馈的就是你的外网ip,对外部世界来说只有这个ip是有意义的。
使用vpc的情况下,你的指令只会打印出内网ip。
Sent from ProtonMail for iOS
在 周三, 4月 28, 2021 在 10:15, qingmo ***@***.***> 来信:
… 那我找一下其他替代的方案,我觉得单靠一个ip.sb不够稳定啊,至少我这边的vps上没有成功获取到,实际上我用
ip address |grep inet | grep -v inet6 | grep -v "127.0.0.1" |awk -F' ' '{print $2}' | awk -F/ '{print $1}' | head -n 1
可以获取到对应的ip。当然,考虑通用方案,我会找一个比较稳定的ip接口
—
You are receiving this because you commented.
Reply to this email directly, [view it on GitHub](#19 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AN72N6PFZGMVA43AVRYADX3TK5VS3ANCNFSM43WDRY7A).
qingmo commented
# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 5********* brd ff:ff:ff:ff:ff:ff
inet 195.**.**.214/24 brd 195.**.**.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 ******** scope link
valid_lft forever preferred_lft forever
# curl -sL -4 ip.sb
# echo $?
6
# curl ifconfig.me
195.**.**.214
# echo $?
0
以上是我vps上的一个执行效果,可以看出来 ip.sb有点不通用,至少需要一个托底的备用方案
qingmo commented
我自己手动搞了一个ip.sb的hosts配置,暂时可以搞定上述问题,应该是vps所处地与ip.sb的解析有问题,这里使用的是德国节点
hijkpw commented
你服务器dns有问题,解析不了ip.sb
Sent from ProtonMail for iOS
在 周三, 4月 28, 2021 在 10:23, qingmo ***@***.***> 来信:
… ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 5********* brd ff:ff:ff:ff:ff:ff
inet 195...214/24 brd 195...255 scope global eth0
valid_lft forever preferred_lft forever
inet6 ******** scope link
valid_lft forever preferred_lft forever
curl -sL -4 ip.sb
echo $?
6
curl ifconfig.me
195...214
echo $?
0
—
You are receiving this because you commented.
Reply to this email directly, [view it on GitHub](#19 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AN72N6JAAMKDMXGCY2L4GLDTK5WRNANCNFSM43WDRY7A).