Hello everyone.
I want to create a gateway out of my laptop and connect it to a Beaglebone Black. The goal is to ssh into the Beagle and also to connect the Beagle to the net.
Laptop:
What i did is create a DHCP server on the network 192.168.0.0/24 using the interface card eth0
On wlan0 i have my wifi connection to the LAN router at 192.168.1.1
Now i tried to write a routing script, on my laptop, to route the packets from eth0 to wlan0 but it didnt work: "bad argument eth0".
# Always accept loopback traffic
iptables -A INPUT -i lo -j ACCEPT
# Allow established connections, and those not coming from the outside
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -m state --state NEW -i ! eth0 -j ACCEPT
iptables -A FORWARD -i eth0 -o wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allow outgoing connections from the LAN side.
iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT
# Masquerade.
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
# Don't forward from the outside to the inside.
iptables -A FORWARD -i eth0 -o wlan0 -j REJECT
I also set the kernel to forward the packets like this
emacs /etc/sysctl.conf
net.ipv4.ip_forward=1 //i uncommented this line in the sample file
Can anyone tell me what am i doing wrong?
Why can is the iptables giving me this error and also am I going about this in a correct way?
Thanks in advance.
Jenia