NICMx / Jool

SIIT and NAT64 for Linux
GNU General Public License v2.0
320 stars 66 forks source link

Restarting jool with a new NAT64 prefix fails #317

Closed telmich closed 4 years ago

telmich commented 4 years ago

I modified jool.conf and launched jool restart on alpine. It gives the following error:

[11:02] router1.place6:/etc/jool# /etc/init.d/jool restart
 * Loading NAT64 instance default ...
Error: The kernel module returned error 22: Sorry; you can't change a NAT64 instance's pool6 for now.xlator_replace() failed. Errcode -22           [ !! ]
 * ERROR: jool failed to start
[11:03] router1.place6:/etc/jool# 

[11:03] router1.place6:/etc/jool# apk list -I | grep jool
jool-tools-static-4.0.6-r3 x86_64 {jool-tools} (GPL-2.0-only) [installed]
jool-tools-bash-completion-4.0.6-r1 x86_64 {jool-tools} (GPL-2.0-only) [installed]
joold-4.0.6-r1 x86_64 {jool-tools} (GPL-2.0-only) [installed]
jool-modules-lts-5.4.7-r0 x86_64 {jool-modules-lts} (GPL-2.0-or-later) [installed]
jool-tools-4.0.6-r1 x86_64 {jool-tools} (GPL-2.0-only) [installed]
[11:04] router1.place6:/etc/jool# 
telmich commented 4 years ago

It correctly (as expected) works when deleting the current instance first:

[11:04] router1.place6:/etc/jool# jool instance remove default
[11:04] router1.place6:/etc/jool# /etc/init.d/jool restart
 * Loading NAT64 instance default ...                                  [ ok ]
[11:04] router1.place6:/etc/jool# 

The pools are updated correctly:

[11:04] router1.place6:/etc/jool# jool pool4 display
+------------+-------+--------------------+-----------------+-------------+
|       Mark | Proto |     Max iterations |         Address |       Ports |
+------------+-------+--------------------+-----------------+-------------+
|          0 |   TCP |       1024 ( auto) |  147.78.195.251 | 61001-65535 |
+------------+-------+--------------------+-----------------+-------------+
[11:04] router1.place6:/etc/jool# jool pool4 display --help
Usage: display [OPTION...]

      --csv                  Print in CSV format
  -i, --icmp                 Print the ICMP table
      --no-headers           Do not print table headers
  -t, --tcp                  Print the TCP table (default)
  -u, --udp                  Print the UDP table
  -?, --help                 Give this help list
      --usage                Give a short usage message
  -V, --version              Print program version

Report bugs to jool@nic.mx.
[11:05] router1.place6:/etc/jool# jool pool4 display --udp
+------------+-------+--------------------+-----------------+-------------+
|       Mark | Proto |     Max iterations |         Address |       Ports |
+------------+-------+--------------------+-----------------+-------------+
|          0 |   UDP |       1024 ( auto) |  147.78.195.251 | 61001-65535 |
+------------+-------+--------------------+-----------------+-------------+
[11:05] router1.place6:/etc/jool# 
ydahhrk commented 4 years ago

Well, it's true that changing pool6 during a file update is currently defined to be illegal on NAT64 instances.

That's the reason why I defined restart as an instance remove followed by file handle (instead of just file handle) in my init script. This forces the pool6 change at the cost of losing the current instance's state (ie. the BIB).

Presumably, the init script of Alpine is only doing the file handle half. Although this seems to be their script and I don't see their definition of restart anywhere, so... I don't really know where the problem is.

Unless you want me to change the behavior of tweaked pool6 in NAT64 (which will require a discussion because it might yield technical issues), I can't really be of much help here. You might want to try contacting the Alpine maintainer.

ydahhrk commented 4 years ago

This seems abandoned, so closing.

Feel free to reopen if a problem persists.