0

For a long time I had troubles using several software (early versions of Teamspeak 3, netcat, openvpn) communicating using UDP protocol. Today I identified the problem.

The main goal for me was to use openvpn over udp which did not seem to work on my server which has multiple ip addresses (runs Ubuntu Server Kernel 3.2.0-35-generic).

Using following config:

# ifconfig -a
eth0      Link encap:Ethernet  HWaddr 11:11:11:11:11:11
          inet addr:1.1.1.240  Bcast:1.1.1.255  Mask:255.255.255.224
          ...

# cat /etc/network/interfaces
auto lo
iface lo inet loopback

auto  eth0
iface eth0 inet static
  address   1.1.1.240
  broadcast 1.1.1.255
  netmask   255.255.255.224
  gateway   1.1.1.225

up ip addr add 1.1.1.249/27 dev eth0
down ip addr del 1.1.1.249/27 dev eth0

up ip addr add 2.2.2.59/29 dev eth0
down ip addr del 2.2.2.59/29 dev eth0
up route add -net 2.2.2.56 netmask 255.255.255.248 gw 2.2.2.57 eth0

# default route to access subnet
up route add -net 1.1.1.224 netmask 255.255.255.224 gw 1.1.1.225 eth0

Problem:

A simple tcpdump at the server reveals that udp packets (tested with netcat and openvpn) received at 2.2.2.59 are replied from 1.1.1.240 (client: 123.11.22.33)

13:55:30.253472 IP 123.11.22.33.54489 > 2.2.2.59.1223: UDP, length 5
13:55:36.826658 IP 1.1.1.240.1223 > 123.11.22.33.54489: UDP, length 5

Question:

Is this problem due to wrong configuration of the network interface or the application itself (OpenVPN, netcat)?

Is it possible for the/an application to listen on multiple ip addresses and reply from the interface address where it received the packet on UDP like it's doing when using TCP.

I know that you can bind applications for specific ip but that would not be the way to go.

I cannot see that this behaviour is due to the UDP protocol itself, since the application is possible to determine at which interface address the packet was received.

kloetpatra
  • 59
  • 1
  • 5

1 Answers1

0

Specifically, openvpn has the --multihome option for handling this scenario correctly.