Re: How to configure a AX25 interface ?



Le 09. 09. 15 13:43, Thomas Haller a écrit :
On Wed, 2015-09-09 at 13:06 +0200, Jean-Christian de Rivaz wrote:
Le 09. 09. 15 10:19, Thomas Haller a écrit :
On Wed, 2015-09-09 at 07:28 +0200, Jean-Christian de Rivaz wrote:
Hello,

I have successfully setup a AX25 interface and NM see it this
way:
nmcli d
DEVICE   TYPE      STATE        CONNECTION
ax0      unknown   connected    ax0
eth2     ethernet  unavailable  --
ttyACM0  gsm       unavailable  --
lo       loopback  unmanaged    --
sit0     sit       unmanaged    --
wlan2    wifi      unmanaged    --

How can I configure NM to add a static default gateway and a
static
DNS
server when, and only when, NM have to use the ax0 interface ?

Basically, adjust the generic connection to have the settings you
want.
See `man nm-settings` for possible options. Especially the "ipv4"
section.

The solution I used was:
nmcli con mod ax0 ipv4.addresses "192.168.222.16/24 192.168.222.15"
nmcli con mod ax0 ipv4.dns "192.168.222.15"
nmcli connection reload

The originally created connection "ax0" was in memory only. By
modifying it, it got persisted to disk. So this is expected.

But even after a reboot, NM don't set the gateway, nor the default
route, nor the DNS:

route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref Use
Iface
192.168.132.0   0.0.0.0         255.255.255.0   U     0 0        0
wlan2
192.168.222.0   0.0.0.0         255.255.255.0   U     0 0        0
ax0

cat /etc/resolv.conf
# Generated by NetworkManager

Then the nmcli con show ax0 command return two 'ax0' settings:

After reboot, NM sees again that an external device ax0 was activated.
Again it will create a temporary, in-memory connection to reflect those
changes.

After doing that, it will look if you have a compatible persistent
connection that might be the one that got activated. Basically, it
compares the newly created one, with what to saved previously.

If it would determine, that you have a similar-enough connection, it
would delete the temporary connection and use the one that matched.

In your case, NM thinks they are different and hence keeps the second
connection.


But regardless of whether NM would match your persistent connection or
not, it would not modify your externally configured device
automatically.
You must manually activate the connection you want:
   `nmcli connection up uuid 048db18b-0d5d-4f40-8ba1-ca492f888b1c`,
This will delete the just generated connection.



Thank you Thomas for this explanation, without your help It's a kind of black magic. I still don't understand how NM think an ax0 is similar enough (or not) to an ax0... Very disturbing for a user.

After some long testing (the actual only link on that device is a 57.6kb AX.25 radio) I have found that the following line work after the kissattach command:
while true; do
    nmcli dev show ax0 >/dev/null 2>&1
    if [ $? -eq 0 ]; then
        break
    fi
    sleep 10
done
nmcli con mod ax0 ipv4.addresses "192.168.222.16/24 192.168.222.15"
nmcli con mod ax0 ipv4.dns "192.168.222.15"
nmcli con up ax0

The loop wait until NM notice that the ax0 interface exists, otherwise I got the 'two ax0' issue. I wonder if the NM dispatcher could be used instead of that waiting loop.

Best Regards,
Jean-Christian



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]