12-21-2013
How to write script for VPN gateway switch?
I have a VPN subscription at Private Internet Access. I mainly use the Switzerland gateway. Now I use it with their client. Many times the Switzerland gateway is down so I have to find another gateway. I want to setup my DD-WRT router (WRT54GL) with the VPN and I want it to automatically switch between the best possible gateways or at least the ones which are working. So basically a script for this or any other solution is also most welcome.
I was discussing this issue at another forum with somebody. He advised me to ask somebody who has UNIX experience. Since I have no UNIX experience, I do not know how to do that. I quote some of what he advised me.
"In any case the basic configuration is the same as if you would say have 2 remote offices. You build a VPN connection to both from your central location. Unlike a office situation where you would route certain networks to each tunnel in your case you need to route the default route. Since the router likes to always has a BEST route even though there are 2 default routes in the routing table it will choose one or the other based on some metric value you set. If the primary link would go down this default route will get removed and it will use only other one that is left. When the primary comes back it will get the better default route back and it will switch back. The only problem with this design is when the VPN stays active but just does not pass any traffic or is getting 90% packet loss. You would have to write a script that could detect something that advanced and cause it to change the metrics on the other default route to make it be selected."
So here it is.
Previously I was seeking advice on how to connect 3 routers wirelessly. Now I am over that, I will connect them with a wire. But I want my DD-WRT router to do the DHCP server. He adviced me this:
"If you want all your traffic to flow only via vpn then what you do is lie to your end devices. Say your main gateway is 192.168.1.1 and your vpn router is 192.168.1.2 You would set the DHCP server (can be any router) to tell the client devices to send all the traffic to 192.168.1.2. The 192.168.1.2 router would know to send all the traffic into the VPN tunnel to the remote site but it also would know that the gateway to the internet was really 192.168.1.1. It would send the tunnel traffic itself to 192.168.1.1 but it would send any other non tunnel internet traffic though the tunnel."
So can somebody help me with my case? Much appreciated.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
What is the best method to ftp files to a machine that is outside of a gateway (0 Replies)
Discussion started by: coburn
0 Replies
2. Shell Programming and Scripting
Hi, have managed to code a script that has a simple menu so for instance if I run:
this will call a help function that displays the programs help, I have coded this in using a case statement so if: case is h) call the help function
The problem is I don't know how to code in the... (3 Replies)
Discussion started by: Del33t
3 Replies
3. IP Networking
Hi all,
I am trying to write a script that launch the cisco vpn client from the command line and then connects to a remote host using ssh.
When i connect to the cisco vpn using vpnclient client connect the last lines of output from that client is
Encryption: 168-bit 3-DES
Authentication:... (0 Replies)
Discussion started by: borderblaster
0 Replies
4. Shell Programming and Scripting
Hi
I am not so good in scripting..trying ot learn it...need guidance of the experts in shell scripting..
Let me explain the scenario first..
a server MX1 is connected to another server MX2 through vpn..every 5 minute a script runs to test vpn connectivity between the 2 servers.when the vpn... (12 Replies)
Discussion started by: renuka
12 Replies
5. Shell Programming and Scripting
Hi all,
This is my first ever post to any forum so, dont let this go in vain...........:)
Here is the scenario........
I have logged into the unix where oracle_sid is initialized for some X database in the .profile.
I have a unix script where some sql query which fetches data from X... (3 Replies)
Discussion started by: sachinkl
3 Replies
6. Linux
Dear Sir
I am a newbie in the world of IP telephony. I have been working with Asterisk PBX (SIP) and Cisco Call Manager (MGCP) but now I am learning on how to work GNUGK for H.323 Gatekeeper.
I am having a problem, configuring static call routing on GNUGK
in the section
... (0 Replies)
Discussion started by: mfondoum
0 Replies
7. IP Networking
Hi,I want connect my ASA 5510 firewall to a 3750 switch with RIP routing. Unfortunately,I am having issues passing the VPN subnet through rip to the 3750.I don't understand how the routing table is populated on the ASA. Any suggestions? (0 Replies)
Discussion started by: Ayaerlee
0 Replies
8. Shell Programming and Scripting
Hello
I want to create a script which will require a mandatory value and optional values which can be supplied using switch. If optional values are not supplied, the script will use the default values mentioned in the script.
For example, how we create user in linux systems.
Please... (3 Replies)
Discussion started by: atanubanerji
3 Replies
9. UNIX for Beginners Questions & Answers
Dear friends
I use RedHat 6.5, which sets the gateway in the configuration file / etc / sysconfig / network as GATEWAY = 192.168.1.26, and the gateway in the configuration file / etc / sysconfig / network-scripts / ifcfg-eth11 as GATEWAY = 192.168.1.256. The two gateways are different.... (6 Replies)
Discussion started by: tanpeng
6 Replies
LEARN ABOUT CENTOS
pmdasnmp
PMDASNMP(1) Performance Co-Pilot PMDASNMP(1)
NAME
pmdasnmp - Gateway from SNMP to PCP (PMDA)
DESCRIPTION
pmdasnmp is a Performance Metrics Domain Agent (PMDA) which provides a generic gateway from PCP queries from a PCP client to SNMP queries
to one or more SNMP agents.
INSTALLATION
If you want access to the SNMP gateway performance metrics, do the following as root:
# cd $PCP_PMDAS_DIR/snmp
# ./Install
If you want to undo the installation, do the following as root:
# cd $PCP_PMDAS_DIR/snmp
# ./Remove
pmdasnmp is launched by pmcd(1) and should never be executed directly. The Install and Remove scripts notify pmcd(1) when the agent is
installed or removed.
CONFIGURATION
TODO: define config file format here - map/set/host/... etc
FILES
$PCP_PMDAS_DIR/snmp/snmp.conf
optional configuration file for pmdasnmp
$PCP_PMDAS_DIR/snmp/Install
installation script for the pmdasnmp agent
$PCP_PMDAS_DIR/snmp/Remove
undo installation script for the pmdasnmp agent
$PCP_LOG_DIR/pmcd/snmp.log
default log file for error and warn() messages from pmdasnmp
SEE ALSO
pmcd(1) and SNMP
3.8.10 Performance Co-Pilot PMDASNMP(1)