java.net.Socket doesn't correctly route over VPN tunnel



Hello all,

I've traced a problem with a VJ# library to a failure of the CLR to use the
correct route to the host.

I'm running Windows XP, patched latest, and the .NET framework 1.1. I also
have the following NICs:
Wired ethernet connection
Wireless NIC
Cisco VPN tunnel interface

The Cisco tunnel is used over our wireless network.

If I disconnect the wired connection and establish the VPN, all software on
the system routes over that interface, except for the CLR as far as I can
tell. The JRE 1.4.2_09-b05 works just fine with the same network
configuration.
Here's my test class:

package ConsoleApplication1;
import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;
public class Class1
{
public static void main( String[] argzes )
throws IOException
{
InputStream in = null;
Socket sock = null;
try
{
sock = new Socket( "gb-doug-srv", 9920 );
sock.close();
}
catch ( Exception e )
{
e.printStackTrace();
try
{
sock.close();
}
catch ( Exception e2 ) {}
}
}
}

### Here's where the test code fails...

D:\Doug\Projects\VJSharp\ConsoleApplication1\bin\Debug>ConsoleApplication1.exe
java.net.NoRouteToHostException:
at java.net.PlainSocketImpl.connect(InetAddress remoteAddr, Int32
remotePort)

at java.net.Socket.<init>(InetAddress host, Int32 port, InetAddress
localAddr
, Int32 localPort)
at java.net.Socket.<init>(String host, Int32 port)
at ConsoleApplication1.Class1.main(String[] argzes) in
D:\Doug\Projects\VJSha
rp\ConsoleApplication1\Class1.jsl:line 22

### Is there a bona fide route to my server? Yes.

D:\Doug\Projects\VJSharp\ConsoleApplication1\bin\Debug>tracert gb-doug-srv

Tracing route to gb-doug-srv.verity.com [z.22.4.119]
over a maximum of 30 hops:

1 1 ms 2 ms 1 ms z.22.6.240
2 2 ms 1 ms 1 ms gb-doug-srv.verity.com [z.22.4.119]

Trace complete.

### Here is the arp entry, to a router obviously

D:\Doug\Projects\VJSharp\ConsoleApplication1\bin\Debug>arp -a

Interface: z.22.4.201 --- 0x30006
Internet Address Physical Address Type
x.249.93.104 00-03-a0-8a-48-39 dynamic
y.75.226.121 00-03-a0-8a-48-39 dynamic
z.22.4.119 00-03-a0-8a-48-39 dynamic

D:\Doug\Projects\VJSharp\ConsoleApplication1\bin\Debug>ConsoleApplication1.exe
java.net.NoRouteToHostException:
at java.net.PlainSocketImpl.connect(InetAddress remoteAddr, Int32
remotePort)

at java.net.Socket.<init>(InetAddress host, Int32 port, InetAddress
localAddr
, Int32 localPort)
at java.net.Socket.<init>(String host, Int32 port)
at ConsoleApplication1.Class1.main(String[] argzes) in
D:\Doug\Projects\VJSha
rp\ConsoleApplication1\Class1.jsl:line 22

D:\Doug\Projects\VJSharp\ConsoleApplication1\bin\Debug>ipconfig

Windows IP Configuration

Ethernet adapter Bluetooth:
Media State . . . . . . . . . . . : Media disconnected

Ethernet adapter Built-in Ethernet:
Media State . . . . . . . . . . . : Media disconnected

Ethernet adapter 802.11:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : z.22.6.127
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : z.22.6.240

Ethernet adapter Cisco VPN:
Connection-specific DNS Suffix . : verity.com
IP Address. . . . . . . . . . . . : z.22.4.201
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : z.22.4.201

D:\Doug\Projects\VJSharp\ConsoleApplication1\bin\Debug>route print
===========================================================================
Interface List
0x1 ........................... MS TCP Loopback interface
0x2 ...00 10 c6 87 51 4d ...... Bluetooth Device (Personal Area Network)
0x4 ...00 12 3f 1b 26 7c ...... Broadcom NetXtreme 57xx Gigabit Controller -
Pac
ket Scheduler Miniport
0x30003 ...00 13 ce 19 91 cd ...... Intel(R) PRO/Wireless 2200BG Network
Connect
ion - Packet Scheduler Miniport
0x30006 ...00 05 9a 3c 78 00 ...... Cisco Systems VPN Adapter - Packet
Scheduler
Miniport
===========================================================================
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 z.22.4.201 z.22.4.201 1
0.0.0.0 0.0.0.0 z.22.6.240 z.22.6.127
26
127.0.0.0 255.0.0.0 127.0.0.1 127.0.0.1 1
z.22.4.0 255.255.255.0 z.22.4.201 z.22.4.201
10
z.22.4.201 255.255.255.255 127.0.0.1 127.0.0.1
10
z.22.6.0 255.255.255.0 z.22.6.127 z.22.6.127
25
z.22.6.0 255.255.255.0 z.22.4.201 z.22.4.201 1
z.22.6.127 255.255.255.255 127.0.0.1 127.0.0.1
25
z.22.6.201 255.255.255.255 z.22.6.127 z.22.6.127 1
z.22.6.240 255.255.255.255 z.22.6.127 z.22.6.127 1
z.22.255.255 255.255.255.255 z.22.4.201 z.22.4.201
10
z.22.255.255 255.255.255.255 z.22.6.127 z.22.6.127
25
224.0.0.0 240.0.0.0 z.22.4.201 z.22.4.201
10
224.0.0.0 240.0.0.0 z.22.6.127 z.22.6.127
25
255.255.255.255 255.255.255.255 z.22.4.201 4 1
255.255.255.255 255.255.255.255 z.22.4.201 2 1
255.255.255.255 255.255.255.255 z.22.4.201 z.22.4.201 1
255.255.255.255 255.255.255.255 z.22.6.127 z.22.6.127 1
Default Gateway: z.22.4.201
===========================================================================
Persistent Routes:
None


.



Relevant Pages

  • Re: LAN routing
    ... I would not mind at all to put a couple of routes in on each of the subnet ... I would like for every host in main Lan to be able to talk to every host on ... Remote Lan = 192.168.101.0/24 ... >> a router at the remote location and setting them on a new IP scheme/ subnet. ...
    (microsoft.public.windows.server.networking)
  • Re: Script to verify route commands - same after reboot?
    ... > want to double-check that the routes are going to be the same after a ... If you receive mail that routes have changed on a host, ... the startup scripts, ...
    (comp.unix.solaris)
  • Re: Secure desktop idea?
    ... Subject: Secure desktop idea? ... > allocate and de-allocate routes. ... Does "as needed" mean when a connection is attempted _to_ a host ... If "as needed" means a connection _to_ it, how is it any different than ...
    (Security-Basics)
  • Re: SMTPClient.Send fails
    ... C:\Documents and Settings\Dale Hoffman\My Documents\Visual Studio ... ystem.IO.IOException: Unable to read data from the transport connection: ... at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) ...
    (microsoft.public.dotnet.general)
  • RE: SMTPClient.Send fails
    ... C:\Documents and Settings\Dale Hoffman\My Documents\Visual Studio ... ystem.IO.IOException: Unable to read data from the transport connection: ... at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) ...
    (microsoft.public.dotnet.general)