Red hat linux

Setup SCTP In Red Hat / CentOS Linux 8

1. Install kernel-modules-extra and SCTP for the currently installed kernel;

yum install kernel-modules-extra-`uname -r`
yum install -y lksctp-tools lksctp-tools-devel lksctp-tools-doc

2. Add sctp to /etc/modules-load.d/* to load sctp before systemd-sysctl.service during boot. Loading sctp before systemd-sysctl.service allows the sctp sysctl.conf settings to be effective;

# cat /etc/modules-load.d/sctp.conf
sctp

3. sctp is blacklisted by default on installation. Comment out the blacklisting to enable sctp to be loaded.

# grep sctp /etc/modprobe.d/*
/etc/modprobe.d/sctp-blacklist.conf:#blacklist sctp
/etc/modprobe.d/sctp_diag-blacklist.conf:#blacklist sctp_diag

4. Reboot (or simply manually load the module, modprobe sctp)

5. Check some command such as ncat provided from the nmap-ncat package to ensure sctp sockets can be created

 # lsmod | grep sctp  # checking the module is loaded
sctp                  409600  4
ip6_udp_tunnel         16384  1 sctp
udp_tunnel             20480  1 sctp
libcrc32c              16384  5 nf_conntrack,nf_nat,nf_tables,xfs,sctp

  # ncat --sctp -k -l 127.0.0.1 8192  # creates an sctp socket on the local host at socket number 8192

# In another terminal, check ss
  # ss -pneomSa | grep -A 1 8192
LISTEN 0      10         127.0.0.1:8192      0.0.0.0:*    users:(("ncat",pid=1912,fd=3)) ino:34833 sk:1 <->
     skmem:(r0,rb212992,t0,tb212992,f0,w0,o0,bl0,d0) locals:127.0.0.1

6. Verify SCTP supported or not.

# checksctp
SCTP supported

Leave a Reply

Your email address will not be published. Required fields are marked *