大网数据广告活动
服务器运维问答

Secondary interface does not receive UDP traffic for *:PORT application

· 52CE 我爱测

I have dedicated server in OVH. Recently I bought additional IP for my server. Default/main IP is on eth0 interface, both TCP and UDP works fine, no problems. I followed OVH tutorial how to add additional IP and it went ok, but o…

问题原文

原帖链接 · AngelDeaD · CC BY-SA 3.0

I have dedicated server in OVH. Recently I bought additional IP for my server. Default/main IP is on eth0 interface, both TCP and UDP works fine, no problems.

I followed OVH tutorial how to add additional IP and it went ok, but on that new IP on eth0:1 interface only TCP traffic works. For example my SSH server is binded to 22 port on all hosts *:22 since SSH server is TCP, I can connect to that via both IP, but I have some other UDP applications that are binded to all hosts, but it's only available via main/default IP via eth0. Strange thing is when I bind UDP application to secondary IP, it is available for secondary IP, which is normal and of course it's not available for main/default IP.

I want, when I bind any UDP application to all hosts on my dedi server, that I can access to that UDP with all IPs.

Main IP interface: ifconfig eth0

eth0
Link encap:Ethernet  HWaddr 38:60:77:21:53:99
inet addr:xxx.xxx.xxx.xxx  Bcast:xxx.xxx.xxx.255  Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
RX packets:784160 errors:0 dropped:0 overruns:0 frame:0
TX packets:908805 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:69402450 (66.1 MiB)  TX bytes:171768853 (163.8 MiB)
Interrupt:20 Memory:fe600000-fe620000

Secondary IP interface: ifconfig eth0:1

eth0:1
Link encap:Ethernet  HWaddr 38:60:77:21:53:99
inet addr:yyy.yyy.yyy.yyy  Bcast:yyy.yyy.yyy.yyy Mask:255.255.255.255
UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
Interrupt:20 Memory:fe600000-fe620000

cat /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    address xxx.xxx.xxx.xxx
    netmask 255.255.255.0
    network xxx.xxx.xxx.0
    broadcast xxx.xxx.xxx.255
    gateway xxx.xxx.xxx.254
auto eth0:1
iface eth0:1 inet static
    address yyy.yyy.yyy.yyy
    netmask 255.255.255.255
    broadcast yyy.yyy.yyy.yyy

I tried to reboot system (shutdown -r now) but it did not helped. I hope I attached all info, if someone need more info to help, just tell me what command output you need.

Thanks in advance

已采纳解答

原帖链接 · James McDonald · CC BY-SA 3.0

It's hard to be specific without knowing exactly which software you're using, but it's possible for example that your UDP-based software is finding the first address and binding to that. You might find that it works if you explicitly bind to 0.0.0.0.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-06-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。