2 Nic's 1 Dial

N

newsreader

here goes

say we have one nic on 100.100.100.100 and second nic on 150.150.150.150
gateway from 150.150.150.150 to 100.100.100.100 works fine and everything is
happy
we are on 150 and want to surf the net for example everything is fine. out
through the 100 gateway

dial up comes on for a third party server and gets a dynamic IP say
200.200.200.200 (no gateway established) as there is already a default
gateway else where.
now lets say that when that connection happens I want to direct a specific
IP on 150 to that newly obtained IP only say 150.150.150.149
if I manually add a route like
route add 150.150.150.149 mask 255.255.255.255 200.200.200.200
everything works as expected
a request to 150.150.150.* goes to 100.100.100.100 via the default gateway
except if the request is to the specific ip of 150.150.150.149 it now goes
to the 200.200.200.200 system.
all is well

question is how can I perform the "route add" automatically based on the
single dynamic ip that the dial up obtains when the connection is
established.
(No the service does not provide a static IP, that would be too easy)
when the connection drops we need the route of 150.150.150.149 to go away
(and it does)
the next time it dials we may get 200.200.200.201 as the assigned IP
so now the route add 150.150.150.149 mask 255.255.255.255 200.200.200.201 is
required

is there a way I can have a post dial or login script on the dial account
create the route based on the ip is gets assigned ?

failing that can someone direct me to the routing table access API, (or
..NET)

when the dial connection is established, I need to redirect a single ip on
one side away from its normal gateway and send it to the ip that the dial up
connection was handed.
it all works if I do it by hand, I just need to automate it

Thanks
 
N

newsreader

found the API GetIpForwardTable and CreateIpForwardEntry in iphlpapi and
created a VB6 app to do what I need, that works great
but now if I don't want to marshal into the iphldapi.dll how can I go about
finding the .net versions of these. So far I have seen nothing similar in
..net (must be there)
 
P

Phillip Windell

newsreader said:
question is how can I perform the "route add" automatically based on the
single dynamic ip that the dial up obtains when the connection is
established.
(No the service does not provide a static IP, that would be too easy)
when the connection drops we need the route of 150.150.150.149 to go away
(and it does)
the next time it dials we may get 200.200.200.201 as the assigned IP
so now the route add 150.150.150.149 mask 255.255.255.255 200.200.200.201 is
required

is there a way I can have a post dial or login script on the dial account
create the route based on the ip is gets assigned ?

Don't make things so complicated.
failing that can someone direct me to the routing table access API, (or
.NET)

It is not a programming or development issue.
when the dial connection is established, I need to redirect a single ip on
one side away from its normal gateway and send it to the ip that the dial up
connection was handed.

This is a Server I assume? If so, it will have RRAS. You just configure
the Static Route for the one destination that represents the "exception" to
the rule. RRAS gives you the ability to specify a modem as an interface, so
you simply create a route to the destination using the modem as the way to
get there. You don't have to use the modem's IP when in RRAS, you just use
the modem itself.

I know of no way to do this ouside of RRAS.
 
N

newsreader

Interesting,
I tried this creating a static route to the modem device, it did not seem to
do what I needed.
the server itself appeared to see the route, but workstations using the
server as the gateway never got there.
they always went the way of the default gateway (expected) and then error'd
and although a default gateway entry of
0.0.0.0 0.0.0.0 RemoteModem
appeared in the route table the specific IP I was trying to redirect never
did.

meanwhile, I wrote a little VB app that reads the route table
GetIpForwardTable looks for what I need and adds the appropriate route
CreateIpForwardEntry, it works. both the server and all workstations can
access the required ip on the appropriate dial interface.
 
P

Phillip Windell

newsreader said:
Interesting,
I tried this creating a static route to the modem device, it did not seem to
do what I needed.

Not *to* the modem. You want to go to the desired destination *via* the
modem.
the server itself appeared to see the route, but workstations using the
server as the gateway never got there.

Define "seeing the route".

If the route was correct and the Server contacted the destination properly
over the proper route but the other machines did not,...then you LAN's
routing scheme isn't properly designed.
meanwhile, I wrote a little VB app that reads the route table
GetIpForwardTable looks for what I need and adds the appropriate route
CreateIpForwardEntry, it works. both the server and all workstations can
access the required ip on the appropriate dial interface.

That only hides the problem,...it doesn't solve it.
 
P

Phillip Windell

newsreader said:
the server itself appeared to see the route, but workstations using the
server as the gateway never got there.

Aside from my other post,...I thought all you wanted was the Server to do
what it was supposed to do over the dialup link,...but other machines had
nothing to do with it. If the Server "see" the route (assuming "sees" means
it works) then you are done,..it works! If you want the server to act as a
"router" for the LAN then that is a whole other can of wormes.

I no longer have any of the old messages, so I no longer have any "context"
for this post. You might have to re-post the original problem. I do too
many posts in too many different groups to remember them all.
 
N

newsreader

No, the program I wrote solves the problem, because it works. ;-)
Not *to* the modem. You want to go to the desired destination *via* the
modem.

not "to" vs. "via" (that's just wording)

in RRAS if I create from scratch (dialog verbosity skipped), Internet
Connection Server -> NAT -> demand-dial (service starts)
create demand dial name (remote router), modem, pick them modem, phone
number etc , route IP packets (checked), account info
finish
IP Routing section create a static entries
(select the Remote router) and enter the destination IP that I want to
target say for example 111.111.111.111 with
a mask of 255.255.255.255 the entry that gets created is (even though I
enter and IP and mask in the dialog) is

Destination,Network mask,Gateway,Interface,Metric,Protocol
0.0.0.0,0.0.0.0,0.0.0.0,Remote Router,1,Static

with no entry created for the specific IP I entered,
even after the connection is established the specific IP never appears in
the route table

on the other hand if I disable RRAS,
create a standard dialup connection, let it connect, get and IP and then
create my route
for 111.111.111.111 to the IP address that the dial connection was provided
such as
route add 111.111.111.111 mask 255.255.255.255 xxx.xxx.xxx.xxx
where xxx is the ip the connection obtained when it connected.

after adding that route everyone (server and all workstations) can see the
normal gateway (outside world) and the specific ip
that has been redirected with the route entry at the server.

as I understand RRAS, it should work as you describe, but it never seems to
create the route.
I am going to suggest that the reason it does not is because the ip we are
targeting is 111.111.111.111
and the IPs being assigned are not in that range. don't ask that is part of
their (the 3rd party) security.
I think RRAS silently fails with the same type of message you would get it
as if you did a
route add 111.111.111.111 mask 255.255.255.255 122.122.122.122
that is that "the gateway does not lie on the same network interface."
That is true, and always will be. So I don't think RRAS will ever work in
this case.

at any rate, what I have works, and that is really all I need it to do.

Thanks very much for your response, I do appreciate it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top