Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

run "route add ..." automatically

Status
Not open for further replies.

yiutin03

MIS
May 15, 2003
76
0
0
HK
Dear all,

I have a VPN to a windows 2000 server in my office,
As my ISP has block my 25 outgoing port, I need route to mail via my office VPN.

I need to open a dos prompt every time after the VPN connection has estblished, and type "route add ...."

is there any automated action in Windows? Thanks
 
A "down and dirty" way is to write a vbs scipt or bat file to call the vpn tunnel up against a wait command, then issue the route statement. That way, you fire up one shortcut (or the file itself), and enter your password. The wait command will make the script pause until the call is completed before proceeding.
 
Not sure of your setup but by default VPN connections in XP at least have your Gateway configured to your VPN link. As such, any email you send should go via your VPN link.

The settings can be found at:
TCP/IP Properties -> Advanced -> Use Default gateway on Remote Network . This checkbox should be enabled.

Alternatively, the route add command you type in can be put into a file which should end with a .cmd or .bat and execute it whenever you do your VPN.



Claudius (What certifications??)
 
Not sure if this will work or not, but if you use a -p in your route add statement, it'll keep the route in there between boots of the machine.
 
netsteady is right. route -p add will add a persistent route which will not disappear after a reboot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top