Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - WiFi AP: Ping from external network to Internal network: (6 Items)
   
WiFi AP: Ping from external network to Internal network  
I have setup my QnX target as WiFi AP. The setup is as follows.

en0 - 192.168.1.102 (dhcp.client) connected to backbone.
wl0 - 192.168.20.1 (dhcpd)

Other WiFi clients are able to associate with WiFi AP and getting IP addresses from dhcpd running in my taget. For 
example: 192.168.20.254 or 192.168.20.253

I have issued following commands for NAT:

sysctl -w net.inet.ip.forwarding=1
mount -Ttcpip lsm-pf-v4.so
pfctl -e -f /etc/pf.conf

From WiFi client, i am able to ping the host (192.168.1.101) that is connected on the backbone and i am able to browse 
the internet. But i am not able to ping 192.168.20.X (neither 192.168.20.1 nor 192.168.20.254) region from the wired 
host (192.168.1.102).

My /etc/pf.conf is as follows

"nat on en0 from wl0/24 to any -> en0"

Please let me know how to make the ping from External network (192.168.1.X) to internal network (192.168.20.X) to work.

Thanks & Regards,
Nizam.

     ----------------------------------------
      Ethernet Client (192.168.1.101)
     -----------------------------------------
                  |
                  |
      ---------------------------------------
       Router (192.168.1.1) --------------------------------------> LAN
      ----------------------------------------
                  |
                  |
     ---------------------------------------
     QnX Target en0 (192.168.1.102)
     QnX Target wl0 (192.168.20.1)
    ----------------------------------------
                  :
                  :
      ------------------------------------
       Wifi Client (192.168.20.254)  
     --------------------------------------      

  ping from 192.168.20.254 to 192.168.1.X is working
  ping from 192.168.1.101 to 192.168.20.X is NOT working
    
     
    
  




               
Re: WiFi AP: Ping from external network to Internal network  
Hi,

I suspect the ping won't work because you have the NAT in between. It 
can only translate outgoing connections.

Cheers!
/P

On 11-03-11 08:27 AM, nizam mohamed wrote:
> I have setup my QnX target as WiFi AP. The setup is as follows.
>
> en0 - 192.168.1.102 (dhcp.client) connected to backbone.
> wl0 - 192.168.20.1 (dhcpd)
>
> Other WiFi clients are able to associate with WiFi AP and getting IP
> addresses from dhcpd running in my taget. For example: 192.168.20.254 or
> 192.168.20.253
>
> I have issued following commands for NAT:
>
> sysctl -w net.inet.ip.forwarding=1
> mount -Ttcpip lsm-pf-v4.so
> pfctl -e -f /etc/pf.conf
>
>  From WiFi client, i am able to ping the host (192.168.1.101) that is
> connected on the backbone and i am able to browse the internet. But i am
> not able to ping 192.168.20.X (neither 192.168.20.1 nor 192.168.20.254)
> region from the wired host (192.168.1.102).
>
> My /etc/pf.conf is as follows
>
> "nat on en0 from wl0/24 to any -> en0"
>
> Please let me know how to make the ping from External network
> (192.168.1.X) to internal network (192.168.20.X) to work.
>
> Thanks & Regards,
> Nizam.
>
> ----------------------------------------
> Ethernet Client (192.168.1.101)
> -----------------------------------------
> |
> |
> ---------------------------------------
> Router (192.168.1.1) --------------------------------------> LAN
> ----------------------------------------
> |
> |
> ---------------------------------------
> QnX Target en0 (192.168.1.102)
> QnX Target wl0 (192.168.20.1)
> ----------------------------------------
> :
> :
> ------------------------------------
> Wifi Client (192.168.20.254)
> --------------------------------------
>
> ping from 192.168.20.254 to 192.168.1.X is working
> ping from 192.168.1.101 to 192.168.20.X is NOT working
>
>
>
>
>
>
>
>
>
>
>
>
> _______________________________________________
>
> Technology
> http://community.qnx.com/sf/go/post83927
>
Re: WiFi AP: Ping from external network to Internal network  
Thanks Patrik, 

Then how to make my WiFi QnX AP work without using NAT?. Since the WiFi network is internal (192.168.X.X), any way we 
need NAT to access external network. My problem is accessing internal network from External network. In linux, the 
following commands achieve this

----------------------------------------------------------------------------------------------
iptables -t nat -A POSTROUTING -o en0 -j MASQUERADE
iptables -A FORWARD -i en0 -o wl0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i wl0 -o en0 -j ACCEPT
-----------------------------------------------------------------------------------------------

What is the correct way doing this in QnX?. 
                    
Re: WiFi AP: Ping from external network to Internal network  
And with that config on Linux, can you ping both ways?

On 11-03-14 02:20 AM, nizam mohamed wrote:
> Thanks Patrik,
>
> Then how to make my WiFi QnX AP work without using NAT?. Since the WiFi
> network is internal (192.168.X.X), any way we need NAT to access
> external network. My problem is accessing internal network from External
> network. In linux, the following commands achieve this
>
> ----------------------------------------------------------------------------------------------
> iptables -t nat -A POSTROUTING -o en0 -j MASQUERADE
> iptables -A FORWARD -i en0 -o wl0 -m state --state RELATED,ESTABLISHED
> -j ACCEPT
> iptables -A FORWARD -i wl0 -o en0 -j ACCEPT
> -----------------------------------------------------------------------------------------------
>
> What is the correct way doing this in QnX?.
>
>
>
>
>
> _______________________________________________
>
> Technology
> http://community.qnx.com/sf/go/post83959
>
Re: WiFi AP: Ping from external network to Internal network  
Yes, both way it is working.  Do i need to set any "route" command for doing this?. How other guys are setting up QnX 
WiFi AP?. Do i need to add any extra commands like "rdr on" in the pf.conf file?.

Thanks.
Attachment: Text ip_router 2.14 KB
Re: WiFi AP: Ping from external network to Internal network  
I have found the issue. The problem is not to do with QnX configuration. The router doesn't know where to forward the 
packet (192.168.20.X). So, In the router, i need to make routing 192.168.20.X packets to 192.168.1.102 which is my QnX 
WiFi's AP Ethernet Port. I am using Cisco Linksys Router (WRT310N). In that under "Setup" -> "Advanced Routing" -> "
Static Routing", i did as follows.

Route Entries (1)
Enter Router Name: test
Destination LAN IP: 192.168.20.0
Subnet Mask: 255.255.255.0
Gatewat: 192.168.1.102
Interface: Lan & Wireless

Now, i am able to access WiFi Clients (Internal) from Wired (External) Network.

Thanks.