This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

WinXP PPTP --> ASL Routing only of a subnet?

I searched this forum for any solution of my problem... but I was't successful.

I have a PPTP-Connection from WinXP to ASL. An now I want to route a subnet like 212.82.155.0/26 thru the VPN to the ASL. And the remaining traffic thru my normal internet-connection.

If I disable "set default route" in the VPN-Connection and set up a manual route on WinXP like
route add 212.82.155.0 mask 255.255.255.192 10.101.0.3
it works great.

Now my problem is that I don't want to determine the dynamic IP which was assinged to my WinXP manually an add the route by hand.

Does anybody know how to do this automatically?!

 [:S]
Greetings
Hermann  


This thread was automatically locked due to age.
Parents
  • Nothing in Google.

    Can you write a (Windows batch) script? I'll give you enough to get started; this relies on NT/XP extensions to the "for" command:


    @echo off
    for /F "tokens=1-2 delims=:" %I in ('ipconfig') do echo "%I"|FindStr /I "address" > NUL: && set ADDR=%J
    for /F "tokens=1-2 delims=:" %I in ('ipconfig') do echo "%I"|FindStr /I "mask" > NUL: && set MASK=%J


    (watch the line wraps; that's an echo statement followed by two for's)

    (this is not written for efficiency; it's just written to work)

    You would use the %ADDR% and %MASK% variables in your route add command.

    I'd give you something more polished and resilient to failure (such as when you don't get brokered a DHCP address; also, what happens if the two successive calls to ipconfig return different results? etc.) but the meter isn't on (and I always have to pay my rent!). Maybe somebody else here wants to finish it for you if you can't.

    You can also use "Windows Scripting Host", but this will make for a logical progression for you to learn bash; other scripting languages can be used too, but you will have to load them.

    If you get stumped, I'll help you further; but let's see what you can do...

    [I can hear them now: "I know this really cool OpenSource site where you can get tips for writing Windows scripts..."]
Reply
  • Nothing in Google.

    Can you write a (Windows batch) script? I'll give you enough to get started; this relies on NT/XP extensions to the "for" command:


    @echo off
    for /F "tokens=1-2 delims=:" %I in ('ipconfig') do echo "%I"|FindStr /I "address" > NUL: && set ADDR=%J
    for /F "tokens=1-2 delims=:" %I in ('ipconfig') do echo "%I"|FindStr /I "mask" > NUL: && set MASK=%J


    (watch the line wraps; that's an echo statement followed by two for's)

    (this is not written for efficiency; it's just written to work)

    You would use the %ADDR% and %MASK% variables in your route add command.

    I'd give you something more polished and resilient to failure (such as when you don't get brokered a DHCP address; also, what happens if the two successive calls to ipconfig return different results? etc.) but the meter isn't on (and I always have to pay my rent!). Maybe somebody else here wants to finish it for you if you can't.

    You can also use "Windows Scripting Host", but this will make for a logical progression for you to learn bash; other scripting languages can be used too, but you will have to load them.

    If you get stumped, I'll help you further; but let's see what you can do...

    [I can hear them now: "I know this really cool OpenSource site where you can get tips for writing Windows scripts..."]
Children