i.MX8MP unable to assign static ip address to wifi interface

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX8MP unable to assign static ip address to wifi interface

1,109 Views
krsuresh
Contributor III

Hi Team,

My board is an i.MX8MP, I am trying to configure static IP addresses for wifi(wlan0) interface, but I am encountering an error in the .yaml file. I would appreciate your assistance in this issue.

 
/etc/systemd/network# netplan --debug apply
** (generate:696): DEBUG: 19:23:45.313: starting new processing pass
** (generate:696): DEBUG: 19:23:45.313: wlan0: adding new route
(generate:696): GLib-GIO-DEBUG: 19:23:45.314: _g_io_module_get_default: Found default implementation local (GLocalVfs) for ?gio-vfs?
/etc/netplan/01-wireless-interface-1.yaml:6:7: Error in network definition: wlan0: No access points defined
      dhcp4: no
      ^

Here are the steps I use to configure static IP addresses for WiFi interfaces.

1) Added netplan in core-minimal-image.
IMAGE_INSTALL:append = " netplan"

2) Since there is no 01-wireless-interface-1.yaml file in /etc/netplan, I have manually added it.
/etc/netplan# cat 01-wireless-interface-1.yaml
network:
  version: 2
  renderer: networkd
  wifis:
    wlan0:
      dhcp4: no
      addresses:
          - 192.168.0.10/24
      routes:
        - to: default
          via: 192.168.0.1

3) netplan --debug apply

 

 

 

Thanks,

Sureshkumar R

0 Kudos
7 Replies

1,096 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hello @krsuresh ,

I hope you are doing well.

I have shared the steps to provide a static IP to wifi interface, Please run them.

1) load the drivers.
2) ifconfig -a (Make sure the interface wlan0 is seen)
3) ifconfig wlan0 up
4) Based on the class and subnet mask, the usable host IP range for the network makes configuration changes
5) Go to the netplan directory located at /etc/netplan.
6) I have shared an example below based on that make changes.
network:
 version: 2
 renderer: NetworkManager
 ethernets:
   eth0:
     dhcp4: no
     addresses: [172.23.207.254/20]
     gateway4: 192.168.1.1
     nameservers:
         addresses: [8.8.8.8,8.8.8.4]
         
now apply those changes by giving the below command
sudo netplan try

I hope it helps!

Thanks & Regards,
Sanket Parekh

0 Kudos

1,087 Views
krsuresh
Contributor III

Hi Sanket,

Thanks for the reply. I hope all is well with you.

With the following configurations, I am attempting to assign a static IP address to the wlan0 interface using netplan. However, it does not assign an IP address. Would any additional steps be required to accomplish this?
 

root@imx8mpsolidrun:~# cat /etc/netplan/50-cloud-init.yaml
network:
version: 2
renderer: NetworkManager
wifis:
wlan0:
addresses: [182.168.4.10/16]
access-points:
Mywifi1:

password: G4XJdbuBVsQeq6Rz
dhcp4: true

 

With this configurations, I am now experiencing a different error,

root@imx8mpsolidrun:~# netplan --debug apply
** (generate:899): DEBUG: 20:06:43.238: starting new processing pass
** (generate:899): DEBUG: 20:06:43.243: wlan0: adding wifi AP 'Mywifi1'
** (generate:899): DEBUG: 20:06:43.244: We have some netdefs, pass them through a final round of validation
** (generate:899): DEBUG: 20:06:43.244: wlan0: setting default backend to 2
** (generate:899): DEBUG: 20:06:43.244: Configuration is valid
** (generate:899): DEBUG: 20:06:43.244: Generating output files..
** (generate:899): DEBUG: 20:06:43.244: networkd: definition wlan0 is not for us (backend 2)
** (generate:899): DEBUG: 20:06:43.244: openvswitch: definition wlan0 is not for us (backend 2)
DEBUG:no netplan generated networkd configuration exists
DEBUG:netplan generated NM configuration changed, restarting NM
DEBUG:wlan0 not found in {}
DEBUG:Merged config:
network:
renderer: NetworkManager
version: 2
wifis:
wlan0:
access-points:
Mywifi1:
password: G4XJdbuBVsQeq6Rz
addresses:
- 182.168.4.10/16
dhcp4: true

DEBUG:Link changes: {}
DEBUG:netplan triggering .link rules for lo
DEBUG:netplan triggering .link rules for eth0
DEBUG:netplan triggering .link rules for wlan0
DEBUG:netplan triggering .link rules for eth1
** (process:896): DEBUG: 20:06:44.070: starting new processing pass
** (process:896): DEBUG: 20:06:44.075: wlan0: adding wifi AP 'Mywifi1'
** (process:896): DEBUG: 20:06:44.076: We have some netdefs, pass them through a final round of validation
** (process:896): DEBUG: 20:06:44.076: wlan0: setting default backend to 2
** (process:896): DEBUG: 20:06:44.076: Configuration is valid
DEBUG:wlan0 not found in {}
DEBUG:Merged config:
network:
renderer: NetworkManager
version: 2
wifis:
wlan0:
access-points:
Mywifi1:
password: G4XJdbuBVsQeq6Rz
addresses:
- 182.168.4.10/16
dhcp4: true

 


Thanks,

Sureshkumar R

0 Kudos

1,075 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hello @krsuresh ,

->Did you run the below command to assign static IP to the wlan0 interface?

ifconfig -a
ifconfig wlan0 up
ifconfig wlan0 <static_ip> netmask <mask_id> up
ifconfig wlan0

Please share the observation.

Thanks & Regards,
Sanket Parekh

0 Kudos

1,072 Views
krsuresh
Contributor III

Hi @Sanket_Parekh 

Yes, I am able to assign static IP as manual. Please find the observation,

root@imx8mpsolidrun:~# ifconfig wlan0
wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 3a:be:83:ac:c9:e7 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

root@imx8mpsolidrun:~# ifconfig wlan0 192.168.5.1 netmask 255.255.255.0 up
root@imx8mpsolidrun:~# ifconfig wlan0
wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.5.1 netmask 255.255.255.0 broadcast 192.168.5.255
ether 3a:be:83:ac:c9:e7 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

 

Thanks,

Sureshkumar R

0 Kudos

1,067 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hello @krsuresh ,

I hope you are doing well.

I'm glad the issue is solved.
Hence Can I close this thread?

Thanks & Regards,
Sanket Parekh

0 Kudos

1,062 Views
krsuresh
Contributor III

Hi @Sanket_Parekh,

 

Thanks for the reply. 

Yes, I am able to configure using ifconfig. But my goal is to configure a static IP address for the board when it is brought up. 

 

Thanks,

SureshKumar R

0 Kudos

1,051 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hello @krsuresh ,

I hope you are doing well.

->OK, If one is using Android BSP then one has to write the same ifconfig commands in init.rc file.
->save that file and restart the board.

It will help

Thanks & Regards,
Sanket Parekh

0 Kudos