LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-09-2024, 09:05 AM   #1
davidhadas
LQ Newbie
 
Registered: May 2024
Posts: 3

Rep: Reputation: 0
Thumbs up vxlan open udp socket on 0.0.0.0 even when local address is set


Hi,

Code:
ip netns add test

ip netns exec test /bin/bash
ip link set dev lo up

ip link add vxlan1 type vxlan id 1 remote 127.0.0.3  local 127.0.0.2 dev lo dstport 4789
ip link set vxlan1 up

netstat -pln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 0.0.0.0:4789            0.0.0.0:*
I was expecting to see that vlanx listens on 127.0.0.2:4789 instead it listens to 0.0.0.0 (which blocks opening 4789 on any other IP in this network namespace, e.g. 127.0.0.3).

(1) Is it intentional to always open on 0.0.0.0? If so, why?
(2) Is there a way to force vxlan to listen only on a specific IP addresses?
(3) This seems to open up systems to vulnerabilities since it does not allow limiting the ingress from which vxlan traffic is accepted on?
(4) No warning is documented in the manual regarding this behavior.
(5) Is this the code being executed? If so, it shows that `udp_conf.local_ip` is zeroed and not set by `saddr` when `vxlan_sock_add` is called.

Code:
struct vxlan_config {
        ...
	union vxlan_addr	saddr;
        ...
}

struct vxlan_dev {
        ...
	struct vxlan_config	cfg;
        ...
};

Tnx, DH
 
Old 05-10-2024, 10:31 PM   #2
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,737

Rep: Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213Reputation: 2213
There’s nothing listening on udp port 4789. If there were, the Status column would contain LISTEN
What’s the tcp entry for port 4789 say?
 
Old 05-10-2024, 11:23 PM   #3
davidhadas
LQ Newbie
 
Registered: May 2024
Posts: 3

Original Poster
Rep: Reputation: 0
@SCASEY,

This is normal for UDP ports - they do not show a LISTENING state
It is not an indication that the port is not open.

Code:
nc -luk 0.0.0.0 1234&
[1] 1954496
root@coco:~# netstat -pln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
udp        0      0 0.0.0.0:1234            0.0.0.0:*                           1954496/nc
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Modify UDP receive socket buffer size for an open socket (not at system level, but socket level) barz_83_LQ Linux - Networking 2 11-27-2017 07:56 PM
LXer: RDO Juno Set up Two Real Node (Controller+Compute) Gluster 3.5.2 Cluster ML2&OVS&VXLAN on Cent LXer Syndicated Linux News 0 11-03-2014 05:30 PM
Unable to receive UDP broadcast from a UDP socket bound to an interface Sreeram B S Linux - Networking 5 05-03-2012 02:44 PM
How to receive UDP and ICMP packets, by one UDP socket(PMTUD) myself_rajat Linux - Networking 0 05-28-2004 05:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration