Accessing internet from device connected to AP

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

Accessing internet from device connected to AP

Jump to solution
1,917 Views
bgaurav1718
Contributor III

Note: This post is the continuation of the previous post. 

I have been trying to intergrate NXP'S IW612 based wifi module with iMX8MPEVK. 

I have followed this document for the setup.

The problem is that I don't get Internet access in the client devices connected to the Access Point. The client devices seem to request for services from the Internet but the device responds unreachable. I have attached a snippet of output from tcpdump below:

01:53:41.901331 IP 172.24.100.5.41720 > nrt12s47-in-f10.1e100.net.https: Flags [S], seq 332091786, win 65535, options [mss 1460,sackOK,TS val 2069380644 ecr 0,nop,wscale 9], length 0


01:53:41.934260 IP 172.24.100.5.43714 > server-18-172-31-104.nrt20.r.cloudfront.net.https: Flags [S], seq 3938392598, win 65535, options [mss 1460,sackOK,TS val 1154171877 ecr 0,nop,wscale 9], length 0


01:53:41.963676 IP 172.24.100.1 > 172.24.100.5: ICMP host server-18-172-31-104.nrt20.r.cloudfront.net unreachable, length 68

Also, I noticed the document is based on 88w8987 WiFi modules. But I have an iw612 based WiFi module. Could this be the reason for difference in the results?

After doing some digging in the web, I found following article, from Toradex  where it is said: 

Toradex's provided Kernel configurations are insufficient for configuring NAT, thus it is important to add and enable the required kernel configs. For this, you can use the menuconfig

Is it necessary to do same with the wifi module I have?

0 Kudos
Reply
1 Solution
1,802 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @bgaurav1718 

Thanks for your feedback.

Please try to change this line in  /etc/udhcpd.conf

 

opt dns 192.168.0.1 #router IP

 

 to below one:

 

opt dns 8.8.8.8 #external dns server

 

And also, do not set default gateway when you configure uap0 IP address:

I mean, if you use:

 

root@imx8mnevk:~# ifconfig uap0 192.168.2.2 netmask 255.255.255.0 up
root@imx8mnevk:~# route add default gw 192.168.2.1

 

Please change it to:

 

root@imx8mnevk:~# ifconfig uap0 192.168.2.2 netmask 255.255.255.0 up

 

 

I have tried on my local side, and now I can visit Internet on my PC which connect to NXP-uap0.

Christine_Li_0-1718351807356.png

 

Best regards,

Christine.

View solution in original post

Tags (1)
15 Replies
1,885 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @bgaurav1718 

Thanks for creating case to us.

For 88W8987 it is similar with IW612 when Wi-Fi  works.

Has your I.MX8MP board connected to Ethernet (can visit internet)and assigned correct IP address?

Firstly please make sure your I.MX8MP's ethernet can visit internet, then refer to the given guide to route the internet from Ethernet to IW612's Wi-Fi(as an AP).

You can also provide me your detailed setup steps and results in a doc or take video/screenshot for better understanding.

 

Best regards,

Christine.

0 Kudos
Reply
1,866 Views
bgaurav1718
Contributor III

@Christine_Li 

I made sure that the eth interface has access to the internet. It is able to ping a remote IP (8.8.8.8) without any issues. 

I have attached a document to show the settings I have used to configure the AP mode. 

 

0 Kudos
Reply
1,855 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @bgaurav1718 

Please let me know your IW612 Wi-Fi driver and FW version, so that I can do a same test with you.

I have I.MX8MP-EVK and IW612 module(Murata 2EL M.2 module).

 

Best regards,

Christine.

Tags (1)
0 Kudos
Reply
1,811 Views
bgaurav1718
Contributor III

I am actually using the Evaluation Kit provided by UBlox. It is called EVK-MAYA-W2 based on MAYA-W276 which is again based on IW612 chipset.

Screenshot 2024-06-14 115143.png

0 Kudos
Reply
1,803 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @bgaurav1718 

Thanks for your feedback.

Please try to change this line in  /etc/udhcpd.conf

 

opt dns 192.168.0.1 #router IP

 

 to below one:

 

opt dns 8.8.8.8 #external dns server

 

And also, do not set default gateway when you configure uap0 IP address:

I mean, if you use:

 

root@imx8mnevk:~# ifconfig uap0 192.168.2.2 netmask 255.255.255.0 up
root@imx8mnevk:~# route add default gw 192.168.2.1

 

Please change it to:

 

root@imx8mnevk:~# ifconfig uap0 192.168.2.2 netmask 255.255.255.0 up

 

 

I have tried on my local side, and now I can visit Internet on my PC which connect to NXP-uap0.

Christine_Li_0-1718351807356.png

 

Best regards,

Christine.

Tags (1)
1,603 Views
bgaurav1718
Contributor III

This solution works in my side as well. Thank you very much @Christine_Li

Can you please explain what the issue was previously and why the changes we make work? This way, I can have a better understanding of the issue and solve it on my own in case it arises again.

0 Kudos
Reply
1,597 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @bgaurav1718 

Thanks for your reply.

The problem is the DNS configurations. The previous DNS configurations is internet unavailable.

When we config the DNS to 8.8.8.8(Google's default DNS), we can visit internet.

 

Best regards,

Christine.

Tags (1)
1,595 Views
bgaurav1718
Contributor III
I now understand the issue of DNS. But why have we not set the default gateway now? I think we need default gateway because the packets destined for external network need to have somewhere to go (which was default gateway). But removing the default gateway seems to be correct method. Why is it so?
0 Kudos
Reply
1,590 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @bgaurav1718 

Thanks for your reply.

I tried without default Gateway, it works, I didn't try with default Gate way.

After you tried with internet available DNS and default Gateway, doesn't it work?

Best regards,

Christine.

Tags (1)
0 Kudos
Reply
1,587 Views
bgaurav1718
Contributor III
I checked by adding default gw entries and the internet access is gone. After removing the entry, internet connection is back again.
0 Kudos
Reply
1,499 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @bgaurav1718 

Thanks for your reply.

I suspect there are two reasons:
1. It is not necessary to set default gateway. I checked my ASUS router, there is also no gateway in the configurations which working as an AP. Please see below:

Christine_Li_0-1718699227387.png

2. The configurations in  /etc/udhcpd.conf 

opt router 192.168.2.1 # uap0 gw IP

It has influence on Internet access.

Best regards,

Christine.

Tags (1)
1,724 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @bgaurav1718 

Have you tried on your side?

Does my suggestion work on your side?

Please let me know whether have any other concerns on this thread I can help you.

 

Best regards,

Christine.

Tags (1)
0 Kudos
Reply
1,847 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @bgaurav1718 

I think I have reproduced your issue on my local side with Linux kernel 6.1.22 and Wi-Fi driver is the default one in this kernel.

Please see below:

Christine_Li_0-1718274993579.png

 

Christine_Li_2-1718275083814.png

Right now I suspect it might be related to Linux kernel version.

I will try to debug and resolve it, once have any updates, I will let you know.

 

Best regards,

Christine.

Tags (1)
1,848 Views
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @bgaurav1718 

Did you execute:

Step 2 Configurations For NAT between uap0 & eth0

# iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
# iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# iptables -A FORWARD -i uap0 -o eth0 -j ACCEPT
# iptables-save > /etc/iptables/iptables.rules

Step 3 Enabling iptables and Restart board
# systemctl --system daemon-reload
# systemctl enable iptables
# reboot

 

If no, can you please execute to have a try?

 

Best regards,

Christine.

1,821 Views
bgaurav1718
Contributor III
I am sure I executed the settings for NAT. I might have forgotten to add the details in the shared document, but I am sure I did.
0 Kudos
Reply