You are not logged in.
Hello,
I have set up my Raspberry Pi as a VPN server so that I can access my CalDav and CardDav server that run on it from anywhere I go. The thing is, to sync my calendars and contacts, I have to enable my VPN. I want, however, surf through the internet using my ethernet or WLAN connection at the time without the traffic being routed through the VPN.
Is there any way I can do that? Have the VPN connection enabled at all times and being able to surf the net without having the traffic flow through the VPN any only have the thunderbird calendar and contacts sync through the VPN?
Thanks!
Phil
Offline
you could use iptables to accomplish this
gateway="your router's default gateway ip"
interface="your network interface name, i.e. enp3s0"
portRange="the list of ports you want to send to your VPN, i.e. 80,443 or 1023:1033"
ip route add default table 100 via "$gateway"
ip rule add fwmark 1 table 100
ip route flush cache
iptables -t mangle -I PREROUTING -i "$interface" -p tcp -m multiport --dport ! "$portRange" -j MARK --set-mark 1
fill in the top stuff, change --dport to --sport if you want it to be the source port instead of the destination port, viola!
Offline