Is it doable? Sure. It isn't any problem. You will need:
- working 3G connection interface
- ethernet link to wireless access point
- iptables configuration
- dnsmasq daemon
ad 1. setup 3G connection so that default routing will be via it's interface – for instance
ad 2. connect RPi to netgear's uplink (internet port) with ethernet cable and setup network between them. It have to be not the same network as on your wireless network. You can control all your network with
dnsmasq DHCP server and switch off DHCP in netgear – if it is possible. Maybe it will require a DHCP pass thought set in netgear's firewall. The best position is when all DHCP allocations are handled by RPi's
dnsmasq. If it isn't possible use DHCP server in netgear (network
192.168.1.0 netmask 255.255.255.0) and DHCP server in
192.168.0.0 netmask 255.255.255.0) which will only supply address for netgear's uplink port – based on its mac address.
So, RPi's ethernet port will have static IP address
192.168.0.254 netmask 255.255.255.0, and netgear's uplink will get
192.168.0.1 netmask 255.255.255.0 from
dnsmasq. Your wireless network in netgear will be
192.168.1.0 netmask 255.255.255.0.
ad 3. You need to masquerade traffic from netgear, so put this:
iptables -A INPUT -i $IFACE -m udp -p udp --dport 67:68 --sport 67:68 -j ACCEPT
iptables -A INPUT -i $IFACE -m udp -p udp --dport 53 -j ACCEPT
iptables -A INPUT -i $IFACE -m tcp -p tcp --dport 53 -j ACCEPT
iptables -A INPUT -i $IFACE -j DROP
iptables -t nat -A POSTROUTING -o OpokaVPN -j MASQUERADE
near the end of
ad 4. IP forwarding is also needed to be enabled. So uncomment
ad 5. as written in 1. you can use
dnsmasq for DHCP allocations on all your internal networks on just for supplying netgear's uplink port with network configuration.
Dnsmasq is also a good, simple, caching DNS server for your clients. If you can use it on wireless network it would be the best.
Dnsmasq can use dns servers from 3G connection or even better – google's