For this, use an Ubuntu 18.04 VM:
- Install stunnel:
sudo apt install stunnel
- In the /etc/stunnel directory, create the stunnel.conf file with the following contents:
cert=/etc/stunnel/stunnel.pem
fips=no
[hear from client]
accept=30000
connect=6514
- While still in the /etc/stunnel directory, create the stunnel.pem certificate:
sudo openssl req -new -x509 -days 3650 -nodes -out stunnel.pem -keyout stunnel.pem
- Start the stunnel daemon:
sudo /etc/init.d/stunnel4 start
- To make it automatically start when you reboot the system, edit the /etc/default/stunnel4 file. Look for this line:
ENABLED=0
Change it to this:
ENABLED=1
- In the /etc/rsyslog.conf file, look for this line at the top:
input(type="imtcp" port="514")
Change it to this:
input(type="imtcp" port="6514")
- After saving the file, restart the rsyslog daemon:
sudo systemctl restart rsyslog
- Using the appropriate iptables, ufw, or nftables command, open port 30000/tcp on the firewall, and close port 514.
- This is the end of the lab.
Next, we'll configure the client.