Articles of ipv6

为什么Nginx只给移动设备一个502错误?

使用Nginx,我得到错误: Error 502 – Bad Request The server could not resolve your request for uri: http://domain.name/file/path 奇怪的是,当我的手机正在使用我手机的数据时,我只能得到这个错误。 当我在Wi-Fi上使用手机或使用台式电脑时,服务器可以提供一切正常的服务。 甚至当我通过Wi-Fi将我的iPad连接到我的手机时,我的手机充当了移动热点。 502错误代码表明,使用php-fpm反向代理或服务请求存在问题。 我没有做这些。 因为这个错误只发生在特定情况下,所以我认为它必须是我的手机发送的请求。 (Nexus 5,Chrome,Android棒棒糖) 我的nginx.conf和其他configuration文件正在通过testing。 我用了: sudo nginx -t 并说“configuration文件语法没问题”,“configuration文件testing成功”。 会发生什么事?

Nginx代理传递 – 禁用ipv6

我有nginx conf如下: server { listen 127.0.0.1:8080; server_name 127.0.0.1; client_max_body_size 20m; include /etc/nginx/conf.d/services/*.conf; # redirect server error pages to the static page /50x.html # error_page 500 /500.json; error_page 501 /501.json; error_page 502 /502.json; error_page 503 /503.json; error_page 504 /504.json; error_page 404 /404.json; location = /500.json { root /opt/lj/nginx; } location = /501.json { root /opt/lj/nginx; } […]

连接到IPv4映射的IPv6地址失败

我试图使用IPv6套接字连接到IPv4地址使用IPv4映射的IPv6地址,在Linux(debian-lenny-64 2.6.26-2-amd64) #include <sys/types.h> #include <sys/socket.h> #include <netdb.h> #include <errno.h> #include <stdlib.h> #include <stdio.h> int main(int argc, void **argv) { struct addrinfo *sa; struct addrinfo *ra; int err = getaddrinfo("2001:DB8::2", 0, 0, &sa); int fd = socket(sa->ai_family, SOCK_DGRAM, 0); int v6only = 0; err = setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, (void *)&v6only, sizeof(v6only)); err = bind(fd, sa->ai_addr, […]

带有IPv6地址的Python TCP套接字失败

我试图绑定一个使用IPv6地址的python tcp套接字。 self.__addr = ('fe80::224:d7ff:fe9d:9800', 5050) self.__type = socket.AF_INTE6 self.__sock = socket.socket(self.__type, socket.SOCK_STREAM) for family, _, _, _, sockaddr in socket.getaddrinfo( self.__addr[0], self.__addr[1], 0, 0, socket.SOL_TCP ): if family == self.__type: self.__addr = sockaddr break self.__sock.bind( self.__addr ) self.__sock.listen(1) 我使用了socket.getaddrinfo()的结果,如其他解决scheme中提到的,但总是得到这个错误: self.__sock.bind( self.__addr ) File "/usr/lib/python2.7/socket.py", line 224, in meth return getattr(self._sock,name)(*args) socket.error: [Errno 22] Invalid […]

snmpset / get返回超时:没有响应ipv6

我使用snmp来查询和设置一些在IPv6模式下的OID。 我使用下面的snmp命令。 我已经检查并configuration它来听取udp6:161。 snmpget -cpublic -v2c udp6:[2001:db8:3c4d::41a9:8e4e:a094:3840] .1.3.6.1.4.1.1429.5.1.1.2.5.6.0 它给出了结果 Timeout: No Response from udp6:[2001:db8:3c4d::41a9:8e4e:a094:3840] 使用ping检查时,给定的IP地址也是活动的。 将conf文件更改为包含rwcommunity6和rocommunity6。 我究竟做错了什么?

如何通过RAW套接字发送修改过的IPv6数据包?

我正尝试通过C Linux中的RAW套接字发送自定义IPv6标头。 我已经使用IP_HDRINCL套接字选项在IPv4中取得了成功,但是没有与IPv6等效的function。 我在这里find了一个解决方法,build议使用socket(AF_INET6, SOCK_RAW, IPPROTO_RAW)与启用IP_HDRINCL套接字选项具有相同的效果。 套接字已经成功创build,我没有得到任何错误,直到我用我的修改头使用sendto函数。 我像这样设置套接字: static int socketFd = 0; static struct sockaddr_in6 remote; int main() { socketFd = socket (PF_INET6, SOCK_RAW, IPPROTO_RAW); if (socketFd < 0) { printf ("An error ocurred while creating the socket.\n"); exit (2); } remote.sin6_family = AF_INET6; remote.sin6_port = htons (25000); if (inet_pton (AF_INET6, "fd00:c0de::70d6:4ab9:115d:8cda", &(remote.sin6_addr)) != […]

在linux上检索eth0 ipv6地址

我期待在我的一个shell脚本中使用我的eth0 ipv6地址。 我可以使用ifconfig和grep来检索它,但是我确定它必须在某个文本文件中我没有看到的地方,这最终会使检索更容易。 任何人都知道我应该看什么? 谢谢

对使用普通套接字的ipv6多播有什么要求?

我正在处理一个旧的代码库,其中ipv6多播似乎不工作。 当我尝试绑定()套接字到ff01 :: 1,它失败。 套接字正在我的以太网接口中创build。 将套接字绑定到“::”in6addr_any会导致绑定成功,但除了应用程序本身使用给定的套接字(设置了IPV6_MULTICAST_LOOP)发送的套接字外,没有收到任何数据包。 这些数据包似乎永远不会离开应用程序。 在尝试捕获以太网接口中的数据包时,它们在wireshark中不可见。 只有传入的外部多播数据包可见。 他们都没有达到我的申请。 系统是Ubuntu 16.04与Linux 4.4.0。 设置代码示例: #define MCASTADDRC "ff01::1" int mcast::bind_mcast(const char *interface) { this->net = socket(AF_INET6, SOCK_DGRAM, 0); inet_pton(AF_INET6,MCASTADDRC,&this->multicast.ipv6mr_multiaddr); this->ifaceaddr.sin6_family = AF_INET6; this->ifaceaddr.sin6_port = htons(SRVPORT); this->ifaceaddr.sin6_addr = in6addr_any; // interface for multicast this->mcastaddr.sin6_family = AF_INET6; this->mcastaddr.sin6_port = htons(SRVPORT); this->mcastaddr.sin6_addr = this->multicast.ipv6mr_multiaddr; int opcoes = fcntl(this->net, F_GETFL, […]

在Ubuntu 12.10中不能包含“linux / in6.h”而没有错误

我不能包含linux/in6.h头到我的源代码没有得到这些重定义错误: In file included from mypmtud.cc:30:0: /usr/include/linux/in6.h:30:8: error: redefinition of 'struct in6_addr' In file included from /usr/include/netdb.h:28:0, from mypmtud.cc:23: /usr/include/netinet/in.h:198:8: error: previous definition of 'struct in6_addr' In file included from mypmtud.cc:30:0: /usr/include/linux/in6.h:46:8: error: redefinition of 'struct sockaddr_in6' In file included from /usr/include/netdb.h:28:0, from mypmtud.cc:23: /usr/include/netinet/in.h:239:8: error: previous definition of 'struct sockaddr_in6' In file included from […]

在gstreamer中禁用DNS IPv6查找

最初的问题:当在特定客户networking上使用gstreamer ( gst-launch命令)读取httpstream时,在stream开始加载之前,我经常(并不总是)观察到5秒的初始​​延迟。 经过一番调查后,我发现(这是Wireshark),这是由DNSparsing问题引起的,特别是AAAA查询(IPv6)在高频率下(特别是在这个networking上)失败(无响应)并导致等待 – 5秒后重试。 我在使用“wget”时观察到同样的问题,但是没有使用“wget -4”,因为它不执行AAAA查询。 改变networking基础设施不是一个select。 因此,我想知道运行gstreamer时是否可以跳过AAAA / IPv6 DNS查找,就像wget的“-4”选项一样。