the arduino yun is connected to a router via wifi
and to a computer via ethernet.
i'm trying to do a ping from the computer to the router.
how can i configure the arduino yun to operate as a router and to forward the ip from the ethernet subnet to the wifi subnet
thank you
my goal is to move packets that arrive from 192.168.6.0/24 network to the gateway 192.168.1.162 (it's the wifi that's connected to the network router - it's ip is 192.168.1.253)
i write the command: ip route add 192.168.6.0/24 via 192.168.1.162 dev wlan0
and get this message: RTNETLINK answers: File exists
i get ping from a computer in the 192.168.6.0/24 to the wifi 192.168.1.162 but not to the router 192.168.1.253
the route command looks like this:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
192.168.1.0 192.168.1.162 255.255.255.0 UG 0 0 0 wlan0
192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0
192.168.5.0 * 255.255.255.0 U 0 0 0 eth0
192.168.6.0 * 255.255.255.0 U 0 0 0 eth1
Forwarding packets is not achieved with the routing table but with a firewall. Try this Firewall configuration [Old OpenWrt Wiki] : it has a Forwardings paragraph. Also, don't forget to install the requirements
i'm not interested in port forwarding
but ip forwarding. when i get data from the network connected to eth1 with the dest ip of the network connected to wlan0, i want the yun to act as a router and forward the data to the right network
inno3D:
i'm not interested in port forwarding
but ip forwarding. when i get data from the network connected to eth1 with the dest ip of the network connected to wlan0, i want the yun to act as a router and forward the data to the right network
I'm not a network expert but I see two possible mistakes.
First, both your zones have option forward REJECT which suggests forward won't work despite of the configuration.
Second, by quoting the docs
To allow bidirectional traffic flows between two zones, two forwardings are required, with src and dest reversed in each.
Since ping relies in receiving back an ACK packet, you may want to add the reverse forward rule
the ipforward in sysctl.conf enable the forwarding inside the yun
If you need go outside your network to the intenet from the arduino lan you need masq the package to your adsl router for natting
I f you want see from clients of your home lan the arduino yun lan clients you need staticly route the arduino yun lan subnet to the arduino yun IP of the wan card on the default gateway of your home lan