How to forward packets between two interfaces?
Solution 1:
You first need to enable IP forwarding on your system. To do it just this once, use
sysctl -w net.ipv4.ip_forward=1
or
echo 1 > /proc/sys/net/ipv4/ip_forward
as root. If you want to make it permanent, edit
/etc/sysctl.conf
and add a line containing
net.ipv4.ip_forward = 1
This will be applied on reboot or when you run
sysctl -p /etc/sysctl.conf
Once that is done, you probably need to NAT connections, as it is unlikely your router knows that the 192.168.1.0/24 network is accessible through 192.168.42.13. If 192.168.42.13 is static, you can use
iptables -t nat -A POSTROUTING -i wlan0 -s 192.168.1.0/24 -j SNAT --to-source 192.168.42.13
otherwise use
iptables -t nat -A POSTROUTING -i wlan0 -s 192.168.1.0/24 -j MASQUERADE
Check the Ubuntu IptablesHowTo for how to save those rules when rebooting.