Here is my situation:
I have an OpenVPN 2.1 server installed on a Amazon EC2 AMI Linux. My home has a Tomato router (192.168.1.1) and behind it, it's connected with several PCs.
Here is the server config file on the EC2:
port 1194
proto udp
dev tun
server 10.8.0.0 255.255.255.0
ca ca.crt
cert server.crt
key server.key
dh dh1024.pem
client-config-dir ccd
route 192.168.1.0 255.255.255.0 10.8.0.1
push "redirect-gateway def1"
topology subnet
client-to-client
keepalive 10 120
comp-lzo
persist-key
persist-tun
ping-timer-rem
daemon
status server.log
verb 3
fragment 1400
mssfix
IPtables / NAT / IP forwarding should be properly setup on the EC2 OpenVPN server.
Now, what I want is, if I use my Tomato router to connect to the EC2 OpenVPN server as a client, all the Internet traffic from the PCs that are connected to the router would go through the VPN tunnel.
The situation now is:
Without the line: push "redirect-gateway def1", all the PCs behind the router can ping the EC2 OpenVPN server and vice versa. But the Internet traffic doesn't go through VPN.
If I enable the line: push "redirect-gateway def1", the Internet for the PCs are lost. The router and the PCs are not able to ping the OpenVPN server.
I did a little research on this and it seems redirect-gateway would screw up the routing table of the client. But if it is the case, how can I achieve my goal to browse the Internet through the tunnel?
Thanks in advance, this problem has been bugging for several days!