Linux/RHEL5 : UDP on IPv6 does not work on the same pc 问题

标签 linux sockets udp ipv6

我尝试在同一台电脑上使用 UDP 和 IPv6 设置 netcat 服务器/客户端。

这是我电脑上的界面:

[root@rh55hp360g7ss7 trunk_dir]# ifconfig
eth0      Link encap:Ethernet  HWaddr xxx
          inet addr:192.168.255.166  Bcast:192.168.255.255  Mask:255.255.255.0
          inet6 addr: fe80::1ec1:deff:fef3:4870/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:21948499 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24300265 errors:0 dropped:0 overruns:0 carrier:0
          collisions:360733 txqueuelen:1000
          RX bytes:3645218404 (3.3 GiB)  TX bytes:1672728274 (1.5 GiB)
          Interrupt:162 Memory:f4000000-f4012800

然后我启动 netcat 服务器:

nc -6ul fe80::1ec1:deff:fef3:4870%eth0 5678

和 netcat 客户端(仍在同一台电脑上)

nc -6u fe80::1ec1:deff:fef3:4870%eth0 5678

但是,当我在 NetCat 客户端中输入内容时,没有任何内容传输到服务器。

同样的例子在以下情况下有效

  • 我在另一台电脑上启动 netcat 客户端
  • 我使用的是 TCP 而不是 UDP(即当我删除 -u 选项时)
  • 当我使用 IPv4 而不是 IPv6 时(即当我删除 -6 选项并使用 IPv4 地址时)。

有什么想法吗?

TSohr.

这是路由表,希望对您有帮助:

[root@rh55hp360g7ss7 trunk_dir]# route -A inet6
Kernel IPv6 routing table
Destination                                 Next Hop                                Flags Metric Ref    Use Iface
fe80::/64                                   *                                       U     256    0        0 eth0
::1/128                                     *                                       U     0      265       5 lo
fe80::1ec1:deff:fef3:4870/128               *                                       U     0      10551       1 lo
ff00::/8                                    *                                       U     256    0        0 eth0
[root@rh55hp360g7ss7 trunk_dir]#
## 添加于 2012-03-13
  • 对于::1,它正在工作。
  • 尝试在 PC 上运行 SIP 堆栈时,我遇到了同样的问题。

最佳答案

这只是 Red Hat 和 link-local 作用域的问题。当使用具有全局范围的地址时,它的工作。

我尝试使用 Ubuntu 10.4,在这里它也可以使用链接本地地址。

这是我的 Red Hat 发行版: [root@BETESIP02 sipp]# uname -a Linux BETESIP02 2.6.18-194.el5PAE #1 SMP Tue Mar 16 22:00:21 EDT 2010 i686 i686 i386 GNU/Linux

关于Linux/RHEL5 : UDP on IPv6 does not work on the same pc 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9668136/

相关文章:

ios - [NSDate date] 在多个设备中的不同结果

linux - `tce-load -wi stress` 不起作用?

linux - MC(微软的消息编译器)替代 Linux GCC

linux - 在 Ubuntu 上安装了 clang++3.6,无法选择替代

sockets - 当所有 IP 地址都相同时,指定用于 UDP 写入的以太网端口

c - 通过 UDP 发送非文本文件不起作用

Delphi indy 远程主机UDP客户端/服务器

linux - 替换 sed 中的控制字符

c# - Azure:无法执行套接字上的操作,因为系统缺乏足够的缓冲区空间或队列已满

c - 如何确定用户的路由器/ISP 是否不支持 IPv6 连接?