Hi albertogeniola,
If you reboot your VyOS instance or you run a configuration command for conntrack, a perl script will build the conntrackd.conf again, and changes will be overwritten. That’s why I suggested to run this the default way.
However, you can set up a script to run everytime you boot your VyOS and change the port at conntrackd.conf.
For example:
I’ve created a conntrackd.conf file at /config/scripts
vyos@vyos:~$ cd /config/scripts
vyos@vyos:/config/scripts$ ls
conntrackd.conf vyos-postconfig-bootup.script
Then you can copy /etc/conntrackd/conntrackd.conf content
nano /config/scripts/conntrackd.conf
paste the content and change only the port value.
vyos-postconfig-bootup.script it is a script that runs immediatly after booting, so here we will replace /etc/conntrackd/conntrackd.conf with /config/scripts/conntrackd.conf that we’ve created
vyos@vyos:/config/scripts$ sudo nano vyos-postconfig-bootup.script
!/bin/sh
#This script is executed at boot time after VyOS configuration is fully applied.
#Any modifications required to work around unfixed bugs
#or use services not available through the VyOS CLI system can be placed here.
sudo su
systemctl stop conntrackd
cp /config/scripts/conntrackd.conf /etc/conntrackd/conntrackd.conf
systemctl start conntrackd
exit
the script says that everytime you boot VyOS you’re going to: stop conntrack daemon > replace conntrackd.conf with the one we’ve created and changed the port > run conntrack daemon
vyos@vyos:~$ show conntrack table ipv4
TCP state codes: SS - SYN SENT, SR - SYN RECEIVED, ES - ESTABLISHED,
FW - FIN WAIT, CW - CLOSE WAIT, LA - LAST ACK,
TW - TIME WAIT, CL - CLOSE, LI - LISTEN
CONN ID Source Destination Protocol TIMEOUT
1475121917 192.168.0.100:43920 192.168.0.17:22 tcp [6] ES 432000
3379404573 127.0.0.1:35646 127.0.0.1:53 udp [17] 9
418802928 192.168.0.17:54820 10.10.5.5:9999 udp [17] 29
1715118500 127.0.0.1:41998 127.0.0.1:53 udp [17] 9
3047112562 192.168.0.17 224.0.0.18 vrrp [112] 599
3098682239 192.168.0.1:9431 192.168.0.255:9431 udp [17] 29
3263140913 127.0.0.1:33912 127.0.0.1:53 udp [17] 3
1569728376 127.0.0.1:44081 127.0.0.1:53 udp [17] 1
2212209515 127.0.0.1:47051 127.0.0.1:53 udp [17] 3
1993901470 127.0.0.1:46658 127.0.0.1:53 udp [17] 1
2488012074 192.168.0.4:57621 192.168.0.255:57621 udp [17] 0
2016708421 127.0.0.1:60911 127.0.0.1:53 udp [17] 3
4003937088 127.0.0.1:49845 127.0.0.1:53 udp [17] 3
3638826111 192.168.0.17 224.0.0.22 igmp [2] 421
You can see it shows at the conntrack table that I changed the port to UDP 9999 for unicast dst peer 10.10.5.5