Re: How to configure a AX25 interface ?



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    --

The ax0 interface have only a IP address (configured while creating
the
ax0):
ifconfig ax0
ax0       Link encap:AMPR AX.25  HWaddr MENHIR-6
            inet addr:192.168.222.16  Bcast:192.168.222.255
Mask:255.255.255.0
            UP BROADCAST RUNNING  MTU:256  Metric:1
            RX packets:832 errors:14 dropped:0 overruns:0 frame:0
            TX packets:688 errors:0 dropped:0 overruns:0 carrier:0
            collisions:0 txqueuelen:10
            RX bytes:74961 (73.2 KiB)  TX bytes:89851 (87.7 KiB)

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 ? This
is
on a Debian Jessie system, so there is no /etc/sysconfig directory.
The device ax0 was created and upped outside of NM's knowledge, so NM
created a temporary connection "ax0" to reflect that external setup.
This is what you see as active in `nmcli d`.
You can modify and reuse this created connection, or create a different
connection (possibly deleting the generated one).

Note that NM doesn't understand AX25 devices, but it should still work
to do Layer3/IP configuration. In general such unknown devices is
treated as "generic".
If you look at the created connection
    `nmcli connection show ax0`
you should see that it's of connection.type=generic.

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


Many Thanks Tomas for the hint.

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.16"
nmcli connection reload

It created the appropriate file:
cat /etc/NetworkManager/system-connections/ax0
[connection]
id=ax0
uuid=048db18b-0d5d-4f40-8ba1-ca492f888b1c
interface-name=ax0
type=generic
autoconnect=false
timestamp=1441795214

[ipv6]
method=ignore

[ipv4]
method=manual
dns=192.168.222.16;
address1=192.168.222.16/24,192.168.222.15
route1=192.168.222.0/32,192.168.222.15

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:

connection.id:                          ax0
connection.uuid: 048db18b-0d5d-4f40-8ba1-ca492f888b1c
connection.interface-name:              ax0
connection.type:                        generic
connection.autoconnect:                 no
connection.timestamp:                   1441774216
connection.read-only:                   no
connection.permissions:
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.secondaries:
connection.gateway-ping-timeout:        0
ipv4.method:                            manual
ipv4.dns:                               192.168.222.16
ipv4.dns-search:
ipv4.addresses: { ip = 192.168.222.16/24, gw = 192.168.222.15 } ipv4.routes: { dst = 192.168.222.0/32, nh = 192.168.222.15, mt = 0 }
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv6.method:                            ignore
ipv6.dns:
ipv6.dns-search:
ipv6.addresses:
ipv6.routes:
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.dhcp-hostname:                     --

connection.id:                          ax0
connection.uuid: 9379b79c-81c0-4909-9eb9-de4445f666ef
connection.interface-name:              ax0
connection.type:                        generic
connection.autoconnect:                 no
connection.timestamp:                   1441796313
connection.read-only:                   no
connection.permissions:
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.secondaries:
connection.gateway-ping-timeout:        0
ipv4.method:                            manual
ipv4.dns:
ipv4.dns-search:
ipv4.addresses: { ip = 192.168.222.16/24, gw = 0.0.0.0 }
ipv4.routes:
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv6.method:                            ignore
ipv6.dns:
ipv6.dns-search:
ipv6.addresses:
ipv6.routes:
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.dhcp-hostname:                     --
GENERAL.NAME:                           ax0
GENERAL.UUID: 9379b79c-81c0-4909-9eb9-de4445f666ef
GENERAL.DEVICES:                        ax0
GENERAL.STATE:                          activated
GENERAL.DEFAULT:                        no
GENERAL.DEFAULT6:                       no
GENERAL.VPN:                            no
GENERAL.ZONE:                           --
GENERAL.DBUS-PATH: /org/freedesktop/NetworkManager/ActiveConnection/0
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/Settings/3
GENERAL.SPEC-OBJECT:                    --
GENERAL.MASTER-PATH:                    --
IP4.ADDRESS[1]:                         ip = 192.168.222.16/24, gw = 0.0.0.0

The first one correspond to the right settings, the second one correspond to the crude reality. Probably that the connection.uuid play a role here, but how to handle this properly ?

Note: I would love to create the ax0 connection using NM. In practice it's just matter of calling the 'kissattach' command. I there a way to tell NM a command it must call to setup a new interface ?

Best Regards,
Jean-Christian



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