0

I have a computer with wifi adapter (interface wlp3s0) which can work in access point mode.

Using network-manager I've created wifi access point with static addresses:

nmcli c a type wifi ifname wlp3s0 con-name 'hotspot' autoconnect no ssid 'test'
nmcli c m 'hotspot' 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method static ipv4.addresses '192.168.3.1'
nmcli c m 'hotspot' wifi-sec.key-mgmt wpa-psk
nmcli c m 'hotspot' wifi-sec.psk '12345678'
nmcli c m 'hotspot' ipv4.gateway '192.168.3.1'
nmcli c m 'hotspot' ipv4.routes '192.168.3.0/24 192.168.3.1'
nmcli c up 'hotspot'

It works well until I manually enable and disable connection using nmcli c up/nmcli c down - access point appears, I can connect to it.

When I enable autoconnect access points appears and I can connect to it, however there is no manual-defined route 192.168.3.0/24 192.168.3.1 and I can't connect to ssh server running on this computer or do anything related with IP communication.

Why route defined in connection doesn't work in case of autoconnect?

UPD: my connections settings:

$ nmcli c s hotspot
connection.id:                          hotspot
connection.uuid:                        3ecf0211-bd69-4a31-880c-24793bc1bc83
connection.stable-id:                   --
connection.interface-name:              wlp3s0
connection.type:                        802-11-wireless
connection.autoconnect:                 yes
connection.autoconnect-priority:        0
connection.autoconnect-retries:         -1 (default)
connection.timestamp:                   1561903483
connection.read-only:                   no
connection.permissions:
connection.zone:                        --
connection.master:                      --
connection.slave-type:                  --
connection.autoconnect-slaves:          -1 (default)
connection.secondaries:
connection.gateway-ping-timeout:        0
connection.metered:                     unknown
connection.lldp:                        -1 (default)
802-11-wireless.ssid:                   test
802-11-wireless.mode:                   ap
802-11-wireless.band:                   bg
802-11-wireless.channel:                0
802-11-wireless.bssid:                  --
802-11-wireless.rate:                   0
802-11-wireless.tx-power:               0
802-11-wireless.mac-address:            --
802-11-wireless.cloned-mac-address:     --
802-11-wireless.generate-mac-address-mask:--
802-11-wireless.mac-address-blacklist:
802-11-wireless.mac-address-randomization:default
802-11-wireless.mtu:                    auto
802-11-wireless.seen-bssids:            AC:FD:CE:99:9D:78
802-11-wireless.hidden:                 no
802-11-wireless.powersave:              default (0)
802-11-wireless-security.key-mgmt:      wpa-psk
802-11-wireless-security.wep-tx-keyidx: 0
802-11-wireless-security.auth-alg:      --
802-11-wireless-security.proto:
802-11-wireless-security.pairwise:
802-11-wireless-security.group:
802-11-wireless-security.leap-username: --
802-11-wireless-security.wep-key0:      <hidden>
802-11-wireless-security.wep-key1:      <hidden>
802-11-wireless-security.wep-key2:      <hidden>
802-11-wireless-security.wep-key3:      <hidden>
802-11-wireless-security.wep-key-flags: 0 (none)
802-11-wireless-security.wep-key-type:  0 (unknown)
802-11-wireless-security.psk:           <hidden>
802-11-wireless-security.psk-flags:     0 (none)
802-11-wireless-security.leap-password: <hidden>
802-11-wireless-security.leap-password-flags:0 (none)
ipv4.method:                            manual
ipv4.dns:
ipv4.dns-search:
ipv4.dns-options:                       (default)
ipv4.dns-priority:                      0
ipv4.addresses:                         192.168.3.1/32
ipv4.gateway:                           --
ipv4.routes:                            { ip = 192.168.3.0/24, nh = 192.168.3.1 }
ipv4.route-metric:                      -1
ipv4.ignore-auto-routes:                no
ipv4.ignore-auto-dns:                   no
ipv4.dhcp-client-id:                    --
ipv4.dhcp-timeout:                      0
ipv4.dhcp-send-hostname:                yes
ipv4.dhcp-hostname:                     --
ipv4.dhcp-fqdn:                         --
ipv4.never-default:                     no
ipv4.may-fail:                          yes
ipv4.dad-timeout:                       -1 (default)
ipv6.method:                            auto
ipv6.dns:
ipv6.dns-search:
ipv6.dns-options:                       (default)
ipv6.dns-priority:                      0
ipv6.addresses:
ipv6.gateway:                           --
ipv6.routes:
ipv6.route-metric:                      -1
ipv6.ignore-auto-routes:                no
ipv6.ignore-auto-dns:                   no
ipv6.never-default:                     no
ipv6.may-fail:                          yes
ipv6.ip6-privacy:                       -1 (unknown)
ipv6.addr-gen-mode:                     stable-privacy
ipv6.dhcp-send-hostname:                yes
ipv6.dhcp-hostname:                     --
ipv6.token:                             --
proxy.method:                           none
proxy.browser-only:                     no
proxy.pac-url:                          --
proxy.pac-script:                       --
GENERAL.NAME:                           hotspot
GENERAL.UUID:                           3ecf0211-bd69-4a31-880c-24793bc1bc83
GENERAL.DEVICES:                        wlp3s0
GENERAL.STATE:                          activated
GENERAL.DEFAULT:                        no
GENERAL.DEFAULT6:                       no
GENERAL.VPN:                            no
GENERAL.ZONE:                           --
GENERAL.DBUS-PATH:                      /org/freedesktop/NetworkManager/ActiveConnection/2
GENERAL.CON-PATH:                       /org/freedesktop/NetworkManager/Settings/2
GENERAL.SPEC-OBJECT:                    /org/freedesktop/NetworkManager/AccessPoint/7
GENERAL.MASTER-PATH:                    --
IP4.ADDRESS[1]:                         192.168.3.1/32
IP4.GATEWAY:                            --
IP6.ADDRESS[1]:                         fe80::227e:56d:e216:26d3/64
IP6.GATEWAY:                            --
6
  • 1
    Why are you using the device's own address as the gateway? Where are the packets supposed to be routed -- should they go in a loop forever? – user1686 Jun 30 '19 at 13:54
  • Yes, it seems I've copy pasted it from some instructions found in the internet and forget to remove this line when created topic. There is no gateway in my actual connection. I've added actual settings of my connection to the post. – Kamil Zaripov Jun 30 '19 at 14:08
  • There is. You might not have a gateway for 0.0.0.0/0, but you are still specifying 192.168.3.1 as the gateway for 192.168.3.0/24. What is that supposed to mean? (It seems like a long-winded, BSDish way of saying that ipv4.address is 192.168.3.1/24?) – user1686 Jun 30 '19 at 15:00
  • Yes, I don't have default for 0.0.0.0/0. Well, it seems, I don't know how routing table should look in this case. I thought that ipv4.routes '192.168.3.0/24 192.168.3.1' means send all packets going to the 192.168.3.0/24 network to the interface with 192.168.3.1 address. – Kamil Zaripov Jun 30 '19 at 18:44
  • 1
    Yep, it seems you are right, I've removed manual route, set ipv4.address=192.168.3.1/24 and it works... until you down/up connection manually. When autoconnect is enabled for connection there are no routes for 192.168.3.1/24 network, unfortunately. So main problem of the topic remains. – Kamil Zaripov Jul 1 '19 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.