LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 02-16-2017, 07:48 PM   #1
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Rep: Reputation: 95
libreswan apparently not listening on port udp/500


Hi,

I am running libreswan-3.15-8.el7.x86_64 on CentOS 7.

I know my ipsec service is running
Code:
[root@localhost:~] # systemctl status ipsec
● ipsec.service - Internet Key Exchange (IKE) Protocol Daemon for IPsec
   Loaded: loaded (/usr/lib/systemd/system/ipsec.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2017-02-17 01:28:59 WAT; 53min ago
  Process: 4768 ExecStopPost=/usr/sbin/ipsec --stopnflog (code=exited, status=0/SUCCESS)
  Process: 4765 ExecStopPost=/sbin/ip xfrm state flush (code=exited, status=0/SUCCESS)
  Process: 4762 ExecStopPost=/sbin/ip xfrm policy flush (code=exited, status=0/SUCCESS)
  Process: 4753 ExecStop=/usr/libexec/ipsec/whack --shutdown (code=exited, status=0/SUCCESS)
  Process: 4785 ExecStartPre=/usr/sbin/ipsec --checknflog (code=exited, status=0/SUCCESS)
  Process: 4781 ExecStartPre=/usr/sbin/ipsec --checknss (code=exited, status=0/SUCCESS)
  Process: 4779 ExecStartPre=/usr/libexec/ipsec/_stackmanager start (code=exited, status=0/SUCCESS)
  Process: 4775 ExecStartPre=/usr/libexec/ipsec/addconn --config /etc/ipsec.conf --checkconfig (code=exited, status=0/SUCCESS)
 Main PID: 4797 (pluto)
   CGroup: /system.slice/ipsec.service
           ├─4797 /usr/libexec/ipsec/pluto --config /etc/ipsec.conf --nofork
           └─4816 _pluto_adns
While lsof shows the process listening on port udp/500
Code:
[root@localhost:~] # lsof -i udp:500 -n -P
COMMAND  PID USER   FD   TYPE   DEVICE SIZE/OFF NODE NAME
pluto   4797 root   30u  IPv4 17089058      0t0  UDP 1.2.3.4:500
ss is not showing it
Code:
[root@localhost:~] # ss -nap | grep -i udp
udp    UNCONN     0      0        :::58                   :::*                   users:(("NetworkManager",pid=597,fd=18))
And while bringing up the connection it stops at phase2
Code:
[root@localhost:~] # ipsec auto --up conn_name
002 "conn_name" #193: initiating Main Mode
104 "conn_name" #193: STATE_MAIN_I1: initiate
003 "conn_name" #193: received Vendor ID payload [RFC 3947]
003 "conn_name" #193: received Vendor ID payload [FRAGMENTATION c0000000]
002 "conn_name" #193: enabling possible NAT-traversal with method RFC 3947 (NAT-Traversal)
002 "conn_name" #193: transition from state STATE_MAIN_I1 to state STATE_MAIN_I2
106 "conn_name" #193: STATE_MAIN_I2: sent MI2, expecting MR2
003 "conn_name" #193: received Vendor ID payload [Cisco-Unity]
003 "conn_name" #193: received Vendor ID payload [XAUTH]
003 "conn_name" #193: ignoring unknown Vendor ID payload [7af4f6652a64a1e60220e4563d6b8452]
003 "conn_name" #193: ignoring Vendor ID payload [Cisco VPN 3000 Series]
003 "conn_name" #193: NAT-Traversal: Result using RFC 3947 (NAT-Traversal) sender port 500: no NAT detected
002 "conn_name" #193: transition from state STATE_MAIN_I2 to state STATE_MAIN_I3
108 "conn_name" #193: STATE_MAIN_I3: sent MI3, expecting MR3
003 "conn_name" #193: received Vendor ID payload [Dead Peer Detection]
002 "conn_name" #193: Main mode peer ID is ID_IPV4_ADDR: '4.3.2.1'
002 "conn_name" #193: transition from state STATE_MAIN_I3 to state STATE_MAIN_I4
004 "conn_name" #193: STATE_MAIN_I4: ISAKMP SA established {auth=PRESHARED_KEY cipher=aes_256 integ=sha group=MODP1024}
002 "conn_name" #194: initiating Quick Mode PSK+ENCRYPT+TUNNEL+UP+IKEV1_ALLOW+IKEV2_ALLOW+SAREF_TRACK+IKE_FRAG_ALLOW {using isakmp#193 msgid:c76d27fc proposal=AES(12)_256-SHA1(2)_000 pfsgroup=no-pfs}
117 "conn_name" #194: STATE_QUICK_I1: initiate
010 "conn_name" #194: STATE_QUICK_I1: retransmission; will wait 500ms for response
010 "conn_name" #194: STATE_QUICK_I1: retransmission; will wait 1000ms for response
010 "conn_name" #194: STATE_QUICK_I1: retransmission; will wait 2000ms for response
010 "conn_name" #194: STATE_QUICK_I1: retransmission; will wait 4000ms for response
010 "conn_name" #194: STATE_QUICK_I1: retransmission; will wait 8000ms for response
010 "conn_name" #194: STATE_QUICK_I1: retransmission; will wait 16000ms for response
010 "conn_name" #194: STATE_QUICK_I1: retransmission; will wait 32000ms for response
031 "conn_name" #194: max number of retransmissions (8) reached STATE_QUICK_I1.  No acceptable response to our first Quick Mode message: perhaps peer likes no proposal
000 "conn_name" #194: starting keying attempt 2 of an unlimited number, but releasing whack
Finally, obviously the VPN is not up
Code:
[root@localhost:~] # ipsec status
000 using kernel interface: netkey
000 interface lo/lo ::1@500
000 interface lo/lo 127.0.0.1@4500
000 interface lo/lo 127.0.0.1@500
000 interface eth0/eth0 1.2.3.4@4500
000 interface eth0/eth0 1.2.3.4@500
000 interface virbr0/virbr0 192.168.122.1@4500
000 interface virbr0/virbr0 192.168.122.1@500
000  
000  
000 fips mode=disabled;
000 SElinux=disabled
000  
000 config setup options:
000  
000 configdir=/etc, configfile=/etc/ipsec.conf, secrets=/etc/ipsec.secrets, ipsecdir=/etc/ipsec.d, dumpdir=/var/run/pluto/, statsbin=unset
000 sbindir=/usr/sbin, libexecdir=/usr/libexec/ipsec
000 pluto_version=3.15, pluto_vendorid=OE-Libreswan-3.15
000 nhelpers=-1, uniqueids=yes, perpeerlog=no, shuntlifetime=900s, xfrmlifetime=300s
000 ddos-cookies-treshold=50000, ddos-max-halfopen=25000, ddos-mode=auto
000 ikeport=500, strictcrlpolicy=no, crlcheckinterval=0, listen=<any>, nflog-all=0
000 secctx-attr-type=32001
000 myid = (none)
000 debug none
000  
000 nat-traversal=yes, keep-alive=20, nat-ikeport=4500
000 virtual-private (%priv):
000 - allowed subnets: 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, 25.0.0.0/8, 100.64.0.0/10, fd00::/8, fe80::/10
000  
000 ESP algorithms supported:
000  
000 algorithm ESP encrypt: id=3, name=ESP_3DES, ivlen=8, keysizemin=192, keysizemax=192
000 algorithm ESP encrypt: id=6, name=ESP_CAST, ivlen=8, keysizemin=128, keysizemax=128
000 algorithm ESP encrypt: id=12, name=ESP_AES, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=14, name=ESP_AES_CCM_A, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=15, name=ESP_AES_CCM_B, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=16, name=ESP_AES_CCM_C, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=18, name=ESP_AES_GCM_A, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=19, name=ESP_AES_GCM_B, ivlen=12, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=20, name=ESP_AES_GCM_C, ivlen=16, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=252, name=ESP_SERPENT, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm ESP encrypt: id=253, name=ESP_TWOFISH, ivlen=8, keysizemin=128, keysizemax=256
000 algorithm AH/ESP auth: id=1, name=AUTH_ALGORITHM_HMAC_MD5, keysizemin=128, keysizemax=128
000 algorithm AH/ESP auth: id=2, name=AUTH_ALGORITHM_HMAC_SHA1, keysizemin=160, keysizemax=160
000 algorithm AH/ESP auth: id=5, name=AUTH_ALGORITHM_HMAC_SHA2_256, keysizemin=256, keysizemax=256
000 algorithm AH/ESP auth: id=6, name=AUTH_ALGORITHM_HMAC_SHA2_384, keysizemin=384, keysizemax=384
000 algorithm AH/ESP auth: id=7, name=AUTH_ALGORITHM_HMAC_SHA2_512, keysizemin=512, keysizemax=512
000 algorithm AH/ESP auth: id=8, name=AUTH_ALGORITHM_HMAC_RIPEMD, keysizemin=160, keysizemax=160
000 algorithm AH/ESP auth: id=9, name=AUTH_ALGORITHM_AES_XCBC, keysizemin=128, keysizemax=128
000  
000 IKE algorithms supported:
000  
000 algorithm IKE encrypt: v1id=0, v1name=0??, v2id=16, v2name=AES_CCM_C, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=0, v1name=0??, v2id=15, v2name=AES_CCM_B, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=0, v1name=0??, v2id=14, v2name=AES_CCM_A, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=5, v1name=OAKLEY_3DES_CBC, v2id=3, v2name=3DES, blocksize=8, keydeflen=192
000 algorithm IKE encrypt: v1id=24, v1name=OAKLEY_CAMELLIA_CTR, v2id=24, v2name=CAMELLIA_CTR, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=8, v1name=OAKLEY_CAMELLIA_CBC, v2id=23, v2name=CAMELLIA_CBC, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=20, v1name=OAKLEY_AES_GCM_C, v2id=20, v2name=AES_GCM_C, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=19, v1name=OAKLEY_AES_GCM_B, v2id=19, v2name=AES_GCM_B, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=18, v1name=OAKLEY_AES_GCM_A, v2id=18, v2name=AES_GCM_A, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=13, v1name=OAKLEY_AES_CTR, v2id=13, v2name=AES_CTR, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=7, v1name=OAKLEY_AES_CBC, v2id=12, v2name=AES_CBC, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=65004, v1name=OAKLEY_SERPENT_CBC, v2id=65004, v2name=SERPENT_CBC, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=65005, v1name=OAKLEY_TWOFISH_CBC, v2id=65005, v2name=TWOFISH_CBC, blocksize=16, keydeflen=128
000 algorithm IKE encrypt: v1id=65289, v1name=OAKLEY_TWOFISH_CBC_SSH, v2id=65289, v2name=TWOFISH_CBC_SSH, blocksize=16, keydeflen=128
000 algorithm IKE hash: id=1, name=OAKLEY_MD5, hashlen=16
000 algorithm IKE hash: id=2, name=OAKLEY_SHA1, hashlen=20
000 algorithm IKE hash: id=4, name=OAKLEY_SHA2_256, hashlen=32
000 algorithm IKE hash: id=5, name=OAKLEY_SHA2_384, hashlen=48
000 algorithm IKE hash: id=6, name=OAKLEY_SHA2_512, hashlen=64
000 algorithm IKE hash: id=9, name=DISABLED-OAKLEY_AES_XCBC, hashlen=16
000 algorithm IKE dh group: id=2, name=OAKLEY_GROUP_MODP1024, bits=1024
000 algorithm IKE dh group: id=5, name=OAKLEY_GROUP_MODP1536, bits=1536
000 algorithm IKE dh group: id=14, name=OAKLEY_GROUP_MODP2048, bits=2048
000 algorithm IKE dh group: id=15, name=OAKLEY_GROUP_MODP3072, bits=3072
000 algorithm IKE dh group: id=16, name=OAKLEY_GROUP_MODP4096, bits=4096
000 algorithm IKE dh group: id=17, name=OAKLEY_GROUP_MODP6144, bits=6144
000 algorithm IKE dh group: id=18, name=OAKLEY_GROUP_MODP8192, bits=8192
000 algorithm IKE dh group: id=22, name=OAKLEY_GROUP_DH22, bits=1024
000 algorithm IKE dh group: id=23, name=OAKLEY_GROUP_DH23, bits=2048
000 algorithm IKE dh group: id=24, name=OAKLEY_GROUP_DH24, bits=2048
000  
000 stats db_ops: {curr_cnt, total_cnt, maxsz} :context={0,114,64} trans={0,114,4368} attrs={0,114,2912} 
000  
000 Connection list:
000  
000 "conn_name": 192.168.73.0/24===1.2.3.4<1.2.3.4>...4.3.2.1<4.3.2.1>===172.26.64.0/24; prospective erouted; eroute owner: #0
000 "conn_name":     oriented; my_ip=unset; their_ip=unset
000 "conn_name":   xauth info: us:none, them:none,  my_xauthuser=[any]; their_xauthuser=[any]
000 "conn_name":   modecfg info: us:none, them:none, modecfg policy:push, dns1:unset, dns2:unset, domain:unset, banner:unset;
000 "conn_name":   labeled_ipsec:no;
000 "conn_name":   policy_label:unset;
000 "conn_name":   ike_life: 86400s; ipsec_life: 3600s; rekey_margin: 540s; rekey_fuzz: 100%; keyingtries: 0;
000 "conn_name":   retransmit-interval: 500ms; retransmit-timeout: 60s;
000 "conn_name":   sha2_truncbug:no; initial_contact:no; cisco_unity:no; send_vendorid:no;
000 "conn_name":   policy: PSK+ENCRYPT+TUNNEL+UP+IKEV1_ALLOW+IKEV2_ALLOW+SAREF_TRACK+IKE_FRAG_ALLOW;
000 "conn_name":   conn_prio: 24,24; interface: eth0; metric: 0; mtu: unset; sa_prio:auto; nflog-group: unset;
000 "conn_name":   newest ISAKMP SA: #0; newest IPsec SA: #0;
000 "conn_name":   IKE algorithms wanted: AES_CBC(7)_256-SHA1(2)_000-MODP2048(14), AES_CBC(7)_256-SHA1(2)_000-MODP1536(5), AES_CBC(7)_256-SHA1(2)_000-MODP1024(2)
000 "conn_name":   IKE algorithms found:  AES_CBC(7)_256-SHA1(2)_160-MODP2048(14), AES_CBC(7)_256-SHA1(2)_160-MODP1536(5), AES_CBC(7)_256-SHA1(2)_160-MODP1024(2)
000 "conn_name":   ESP algorithms wanted: AES(12)_256-SHA1(2)_000
000 "conn_name":   ESP algorithms loaded: AES(12)_256-SHA1(2)_000
000 "v6neighbor-hole-in": ::/0===::1<::1>:58/34560...%any:58/34816===::/0; prospective erouted; eroute owner: #0
000 "v6neighbor-hole-in":     oriented; my_ip=unset; their_ip=unset
000 "v6neighbor-hole-in":   xauth info: us:none, them:none,  my_xauthuser=[any]; their_xauthuser=[any]
000 "v6neighbor-hole-in":   modecfg info: us:none, them:none, modecfg policy:push, dns1:unset, dns2:unset, domain:unset, banner:unset;
000 "v6neighbor-hole-in":   labeled_ipsec:no;
000 "v6neighbor-hole-in":   policy_label:unset;
000 "v6neighbor-hole-in":   ike_life: 0s; ipsec_life: 0s; rekey_margin: 0s; rekey_fuzz: 0%; keyingtries: 0;
000 "v6neighbor-hole-in":   retransmit-interval: 0ms; retransmit-timeout: 0s;
000 "v6neighbor-hole-in":   sha2_truncbug:no; initial_contact:no; cisco_unity:no; send_vendorid:no;
000 "v6neighbor-hole-in":   policy: PFS+IKEV1_ALLOW+IKEV2_ALLOW+SAREF_TRACK+IKE_FRAG_ALLOW+PASS+NEVER_NEGOTIATE;
000 "v6neighbor-hole-in":   conn_prio: 0,0; interface: lo; metric: 0; mtu: unset; sa_prio:1; nflog-group: unset;
000 "v6neighbor-hole-in":   newest ISAKMP SA: #0; newest IPsec SA: #0;
000 "v6neighbor-hole-out": ::/0===::1<::1>:58/34816...%any:58/34560===::/0; prospective erouted; eroute owner: #0
000 "v6neighbor-hole-out":     oriented; my_ip=unset; their_ip=unset
000 "v6neighbor-hole-out":   xauth info: us:none, them:none,  my_xauthuser=[any]; their_xauthuser=[any]
000 "v6neighbor-hole-out":   modecfg info: us:none, them:none, modecfg policy:push, dns1:unset, dns2:unset, domain:unset, banner:unset;
000 "v6neighbor-hole-out":   labeled_ipsec:no;
000 "v6neighbor-hole-out":   policy_label:unset;
000 "v6neighbor-hole-out":   ike_life: 0s; ipsec_life: 0s; rekey_margin: 0s; rekey_fuzz: 0%; keyingtries: 0;
000 "v6neighbor-hole-out":   retransmit-interval: 0ms; retransmit-timeout: 0s;
000 "v6neighbor-hole-out":   sha2_truncbug:no; initial_contact:no; cisco_unity:no; send_vendorid:no;
000 "v6neighbor-hole-out":   policy: PFS+IKEV1_ALLOW+IKEV2_ALLOW+SAREF_TRACK+IKE_FRAG_ALLOW+PASS+NEVER_NEGOTIATE;
000 "v6neighbor-hole-out":   conn_prio: 0,0; interface: lo; metric: 0; mtu: unset; sa_prio:1; nflog-group: unset;
000 "v6neighbor-hole-out":   newest ISAKMP SA: #0; newest IPsec SA: #0;
000  
000 Total IPsec connections: loaded 3, active 0
000  
000 State Information: DDoS cookies not required, Accepting new IKE connections
000 IKE SAs: total(0), half-open(0), open(0), authenticated(0), anonymous(0)
000 IPsec SAs: total(3), authenticated(3), anonymous(0)
000  
000 #220: "conn_name":500 STATE_QUICK_I1 (sent QI1, expecting QR1); EVENT_v1_RETRANSMIT in 2s; lastdpd=-1s(seq in:0 out:0); idle; import:admin initiate
000 #222: "conn_name":500 STATE_QUICK_I1 (sent QI1, expecting QR1); EVENT_v1_RETRANSMIT in 8s; lastdpd=-1s(seq in:0 out:0); idle; import:admin initiate
000 #218: "conn_name":500 STATE_QUICK_I1 (sent QI1, expecting QR1); EVENT_v1_RETRANSMIT in 29s; lastdpd=-1s(seq in:0 out:0); idle; import:admin initiate
000  
000 Bare Shunt list:
000
If needed here are the ipsec configuration files

Code:
[root@localhost:~] # cat /etc/ipsec.conf
# /etc/ipsec.conf - Libreswan IPsec configuration file

# This file:  /etc/ipsec.conf
#
# Enable when using this configuration file with openswan instead of libreswan
#version 2
#
# Manual:     ipsec.conf.5

# basic configuration
config setup
    # which IPsec stack to use, "netkey" (the default), "klips" or "mast".
    # For MacOSX use "bsd"
    protostack=netkey
    #
    # Normally, pluto logs via syslog. If you want to log to a file,
    # specify below or to disable logging, eg for embedded systems, use
    # the file name /dev/null
    # Note: SElinux policies might prevent pluto writing to a log file at
    #       an unusual location.
    #logfile=/var/log/pluto.log
    #
    # The interfaces= line is only required for the klips/mast stack
    #interfaces="%defaultroute"
    #interfaces="ipsec0=eth0 ipsec1=ppp0"
    #
    # If you want to limit listening on a single IP - not required for
    # normal operation
    #listen=127.0.0.1
    #
    # Do not set debug options to debug configuration issues!
    #
    # plutodebug / klipsdebug = "all", "none" or a combation from below:
    # "raw crypt parsing emitting control kernel pfkey natt x509 dpd
    #  private".
    # Note: "crypt" is not included with "all", as it can show confidential
    #       information. It must be specifically specified
    # examples:
    # plutodebug="control parsing"
    # plutodebug="all crypt"
    # Again: only enable plutodebug or klipsdebug when asked by a developer
    #plutodebug=none
    #klipsdebug=none
    #
    # Enable core dumps (might require system changes, like ulimit -C)
    # This is required for abrtd to work properly
    # Note: SElinux policies might prevent pluto writing the core at
    #       unusual locations
    dumpdir=/var/run/pluto/
    #
    # NAT-TRAVERSAL support
    # exclude networks used on server side by adding %v4:!a.b.c.0/24
    # It seems that T-Mobile in the US and Rogers/Fido in Canada are
    # using 25/8 as "private" address space on their wireless networks.
    # This range has never been announced via BGP (at least upto 2015)
    virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12,%v4:25.0.0.0/8,%v4:100.64.0.0/10,%v6:fd00::/8,%v6:fe80::/10

# For example connections, see your distribution's documentation directory,
# or https://libreswan.org/wiki/
#
# There is also a lot of information in the manual page, "man ipsec.conf"
#
# It is best to add your IPsec connections as separate files in /etc/ipsec.d/
include /etc/ipsec.d/*.conf


[root@localhost:~] # cat /etc/ipsec.d/conn_name.conf 
conn conn_name
    left=1.2.3.4
    leftsubnet=192.168.73.0/24
    right=4.3.2.1
    rightsubnet=172.26.64.0/24
    auto=start
    authby=secret
    ike=aes256-sha1
    ikelifetime=86400
    phase2=esp
    phase2alg=aes256-sha1
    salifetime=3600
    pfs=no


[root@localhost:~] # cat /etc/ipsec.secrets 
include /etc/ipsec.d/*.secrets


[root@localhost:~] # cat /etc/ipsec.d/conn_name.secrets 
%any %any : PSK "secret"
The post is already long with the output and log extracts, sorry for that.
To not add more, know that the firewall allows all ipsec entries.
And I have to assume, at least for the moment, that the other VPN peer (on which I have no access so far) is fine.

Any clue why the udp/500 port vanishes on ss and why the connection does not come up?
 
Old 02-22-2017, 09:05 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
(This comment might be completely irrelevant.)

- - - -

Well, remember that UDP is a datagram protocol, not a socket protocol. It might be listening for incoming packets with this port-number and it might be sending them, but there is no concept of a TCP/IP "socket" that is established with a particular destination and then later torn-down.

A UDP message is simply sent. It is not a two-way connection. There is no guarantee that the packet, once sent, will be received at all, neither in any particular sequence, unlike TCP/IP sockets.

Indeed, there two main reasons why VPNs commonly use UDP:
  1. They don't take up a socket, so they stay out of the way of the (usually, socket-based) communications that they support.
  2. A TCP/IP port scan won't detect an open socket. In the case of OpenVPN with its tls-auth feature, the server can simply drop an incoming packet and thereby remain incognito.

It is always an option to use TCP/IP for the intra-VPN-server connections, but this is not customarily done.

- - - - -

It sounds to me like, in the case at bar, the traffic simply isn't getting through to its destination. Do a traceroute from each of the locations to each of the others, to make sure that the round trip(!) connection routing is as you expect it to be. tcpdump should show the encrypted packets "in flight."

Last edited by sundialsvcs; 02-22-2017 at 09:12 AM.
 
Old 02-22-2017, 10:51 AM   #3
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Original Poster
Rep: Reputation: 95
Hi,

Thanks sundialsvcs for reply.

I had indeed confirmed with tcpdump that requests and corresponding responses are going through.

I do understand the there is no "listening to" UDP socket under port 500.
The strange part is that
Code:
ss -ulnp | grep -w 53
clearly reports something for UDP Bind setup,
but still nothing for VPN with
Code:
ss -ulnp | grep -w 500
At this stage I have made progress.
But still my VPN is not up.
And I want first make sure I fully understand the settings at my local side, and that they are all ok and good.
I will then later get in touch with the administrator at the remote side to troubleshoot together.
 
Old 02-27-2017, 08:16 AM   #4
tshikose
Member
 
Registered: Apr 2010
Location: Kinshasa, Democratic Republic of Congo
Distribution: RHEL, Fedora, CentOS
Posts: 525

Original Poster
Rep: Reputation: 95
Hi,

I will close this thread for several reasons.

I know for sure that ipsec is bound to port udp/500, as shown by lsof and that independently from ss (or netstat) output.
I also confirmed that by capturing tcpdump traces clearly showing meaningful exchanges on port udp/500.

Finally, I have succeeded to bring up the IPsec Security Associations. The problem in my configuration was in rightsubnet not matching what the remote end expected.

I still have firewall and routing problems, but that is for another thread, maybe.
 
  


Reply

Tags
ipsec, libreswan, udp/500, vpn



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
Tomcat6 stops listening on port 80 when i change from port 8080 to port 80 trongthect Linux - Server 1 07-27-2012 05:41 PM
[SOLVED] Is it possible to have TCP and UDP servers listening and writing on the SAME port? Aquarius_Girl Programming 17 02-18-2011 12:42 AM
500 OOPS: could not bind listening IPv4 socket error raevian Slackware 1 11-27-2007 01:53 AM
FTP 500 OOPS: could not bind listening IPv4 socket blipp Linux - Networking 11 07-06-2007 11:14 AM
Suse 10.1 Gateway intercepting udp port 500 louiscastoria Linux - Networking 0 11-17-2006 08:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:18 PM.

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