- 主题:阿里云上申请的机器,没有公网ipv4的,但是
有ipv6吗?
我可以用ipv6和外界互通吗?
--
FROM 218.82.172.*
这是我默认购买的美国区机器,没有买外网ip,为什么不能访问外网呢?难道阿里没有统一出口吗,必须要买弹性公网ip吗?神奇的是,我curl,它居然用的是ipv6,ipv6是默认的开通的吗?如果有了ipv6为什么不能对外访问呢?这个ipv6也不是公网ipv6,难道我要手工分配一个公网ipv6?
Last login: Sat Aug 28 12:22:44 2021 from 100.104.237.252
Welcome to Alibaba Cloud Elastic Compute Service !
[root@AAAA1 ~]# ls
[root@AAAA1 ~]# curl google.com
curl: (7) Failed to connect to 2607:f8b0:4004:801::200e: Network is unreachable
[root@AAAA1 ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.22.144.33 netmask 255.255.240.0 broadcast 172.22.159.255
ether 00:16:3e:02:02:9c txqueuelen 1000 (Ethernet)
RX packets 321460 bytes 256069466 (244.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 222358 bytes 41393478 (39.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
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
【 在 loser002 (~金字塔底层蝼蚁~) 的大作中提到: 】
: 有ipv6吗?
: 我可以用ipv6和外界互通吗?
--
FROM 218.82.172.*
没有外网IP,只是没有对外的IP,不影响服务器访问外面的。
从last login来看,有IP的吧。可能不是固定的eip,重启之后,那个域名的解析地址可能会变。
没有用过美国区的ecs,都是推理的
【 在 loser002 的大作中提到: 】
有ipv6吗?
我可以用ipv6和外界互通吗?
--
FROM 125.119.100.*
你 curl 用的 IPv6 是因为你系统 DNS 默认解析的是 IPv6 地址
这个提示说的就是机器本身没有 IPv6
如果你正常用 v4 就能访问外网了,不需要买公网 IP
【 在 loser002 (~金字塔底层蝼蚁~) 的大作中提到: 】
: 这是我默认购买的美国区机器,没有买外网ip,为什么不能访问外网呢?难道阿里没有统一出口吗,必须要买弹性公网ip吗?神奇的是,我curl,它居然用的是ipv6,ipv6是默认的开通的吗?如果有了ipv6为什么不能对外访问呢?这个ipv6也不是公网ipv6,难道我要手工分配一个公网
: Last login: Sat Aug 28 12:22:44 2021 from 100.104.237.252
: Welcome to Alibaba Cloud Elastic Compute Service !
: ...................
--
FROM 114.242.94.*
怎么把dns默认解析改成ipv4呢?
【 在 wincss (wincss) 的大作中提到: 】
: 你 curl 用的 IPv6 是因为你系统 DNS 默认解析的是 IPv6 地址
: 这个提示说的就是机器本身没有 IPv6
: 如果你正常用 v4 就能访问外网了,不需要买公网 IP
: ...................
--
FROM 139.224.253.*
把本地ipv6地址关了最简单。
【 在 loser002 (~金字塔底层蝼蚁~) 的大作中提到: 】
: 怎么把dns默认解析改成ipv4呢?
--
FROM 220.192.141.*
/etc/gai.conf
# precedence <mask> <value>
# Add another rule to the RFC 3484 precedence table. See section 2.1
# and 10.3 in RFC 3484. The default is:
#
#precedence ::1/128 50
#precedence ::/0 40
#precedence 2002::/16 30
#precedence ::/96 20
#precedence ::ffff:0:0/96 10
#
# For sites which prefer IPv4 connections change the last line to
#
#precedence ::ffff:0:0/96 100
【 在 loser002 (~金字塔底层蝼蚁~) 的大作中提到: 】
: 怎么把dns默认解析改成ipv4呢?
--
FROM 114.242.94.*
我的机器没有这个文件
[root@aaaaa1 ~]# cat /etc/gai.conf
cat: /etc/gai.conf: No such file or directory
[root@aaaaa1 ~]# ls /etc
adjtime cron.monthly firewalld init.d logrotate.conf ntp.conf rc1.d services terminfo
aliases crontab fonts inittab logrotate.d openldap rc2.d sestatus.conf timezone
aliases.db cron.weekly fstab inputrc lsb-release.d opt rc3.d shadow tmpfiles.d
alternatives crypttab gcrypt iproute2 machine-id os-release rc4.d shadow- tuned
anacrontab csh.cshrc GeoIP.conf issue magic pam.d rc5.d shells udev
asound.conf csh.login GeoIP.conf.default issue.net mail.rc passwd rc6.d skel vconsole.conf
at.deny dbus-1 glvnd java makedumpfile.conf.sample passwd- rc.d ssh vimrc
audisp default gnupg jvm man_db.conf pkcs11 rc.local ssl virc
audit depmod.d GREP_COLORS jvm-commmon maven pki redhat-lsb statetab wgetrc
bash_completion.d dhcp groff kdump.conf mke2fs.conf plymouth redhat-release statetab.d wpa_supplicant
bashrc DIR_COLORS group kernel modprobe.d pm resolv.conf subgid X11
binfmt.d DIR_COLORS.256color group- krb5.conf modules-load.d polkit-1 rpc subuid xdg
centos-release DIR_COLORS.lightbgcolor grub2.cfg krb5.conf.d motd popt.d rpm sudo.conf xinetd.d
centos-release-upstream dracut.conf grub.d ld.so.cache mtab postfix rsyncd.conf sudoers yum
chkconfig.d dracut.conf.d gshadow ld.so.conf my.cnf ppp rsyslog.conf sudoers.d yum.conf
chrony.conf e2fsck.conf gshadow- ld.so.conf.d my.cnf.d prelink.conf.d rsyslog.d sudo-ldap.conf yum.repos.d
chrony.keys egl gss libaudit.conf NetworkManager printcap rwtab sysconfig
cloud environment host.conf libnl networks profile rwtab.d sysctl.conf
cron.d ethertypes hostname libuser.conf nscd.conf profile.d sasl2 sysctl.d
cron.daily exports hosts locale.conf nsswitch.conf protocols securetty systemd
cron.deny favicon.png hosts.allow localtime nsswitch.conf.bak python security system-release
cron.hourly filesystems hosts.deny login.defs ntp rc0.d selinux system-release-cpe
【 在 wincss (wincss) 的大作中提到: 】
: /etc/gai.conf
: # precedence <mask> <value>
: # Add another rule to the RFC 3484 precedence table. See section 2.1
: ...................
--
FROM 139.224.253.*
我执行yum是没问题的
说明是能联网的
【 在 loser002 (~金字塔底层蝼蚁~) 的大作中提到: 】
: 有ipv6吗?
: 我可以用ipv6和外界互通吗?
--
修改:loser002 FROM 139.224.253.*
FROM 139.224.253.*
ifconfig也没发现ipv6地址。。。
但是curl就是不行,不会是防火墙的问题吧
[root@aaaaa1 ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.22.146.33 netmask 255.255.240.0 broadcast 172.22.159.255
ether 00:16:3e:02:02:9c txqueuelen 1000 (Ethernet)
RX packets 407382 bytes 288015114 (274.6 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 335712 bytes 59890179 (57.1 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
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
【 在 loser002 (~金字塔底层蝼蚁~) 的大作中提到: 】
: 我的机器没有这个文件
: [root@aaaaa1 ~]# cat /etc/gai.conf
: cat: /etc/gai.conf: No such file or directory
: ...................
--
FROM 139.224.253.*