You will probably want to:
- Define both network interfaces and their networks (in /etc/network/interaces on raspbian)
- Enable IP forwarding
- Set up Network Address translation (NAT) using iptables/netfilter
- Set your rpi as default gateway on your other devices
There is no one-size-fits-all configuration, but here's the configuration that I *think* you're looking for:
Code: Select all
# Enable ip forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
# Clear all existing iptables rules
/sbin/iptables -F
/sbin/iptables -t nat -F
/sbin/iptables -t mangle -F
# Create new rules for routing between your wireless and wired connection
/sbin/iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
/sbin/iptables -A FORWARD -i wlan0 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
/sbin/iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT
This assumes that your wireless connection is defined as wlan0, and that your wired connection is defined as eth0.
The example should certainly point you in the right direction.
Good luck, and let us know how it worked out!
Dave Driesen
Linux dev and oldskool elite