Remoting Problems in Multi-IP and multi-nic Intranet and Internet Environments

Source: Internet
Author: User

If the remoting server has multiple NICs and multiple IP addresses, the client callback may fail, after debugging, the client will call back to another IP address on the server (for example, the Internet address, rather than the Intranet address ). Generally, the configuration of the remoting server is as follows:

< Channel Ref = "TCP" Port = "55555" >

Or useCodeMethod:

Idictionary props =   New Hashtable ();
Props [ " Port " ] =   55555 ;

Ichannel Channel= NewTcpchannel (props, clientprovider, serverprovider );

There are several solutions to this problem:

 

1. Bind the channel to the machine name (using "machinename") instead of the IP address. However, this requires that customers of different network segments can find this server through the same DNS name. This attribute overwritesUseipaddressAttribute settings.

< Channel Ref = "TCP" Port = "55555" Machinename = "Firewall.yourdomain.com"   />

Code method:

Idictionary props =   New Hashtable ();
Props [ " Port " ] =   55555 ;
Props [ " Machinename " ] =   " Firewall.yourdomain.com " ;

Ichannel Channel= NewTcpchannel (props, clientprovider, serverprovider );

For details about the "machinename" attribute, refer to msdn:
Http://msdn.microsoft.com/en-us/library/c5zztdc3%28VS.80%29.aspx

 

2. Open a channel for each IP address on the server and use "bindto ".

For details about the bindto attribute, see msdn: specify an IP address of the NIC to bind to when more than one Nic is installed in a machine. this attribute can only be used in the server side.

Configuration example:

< Channel Ref = "TCP" Port = "55555" Bindto = "197.118.137.8" >
  < Serverproviders >
< Formatter Ref = "Soap" Typefilterlevel = "Full"   />
< Formatter Ref = "Binary" Typefilterlevel = "Full"   />
  </ Serverproviders >
</ Channel >

3. Obtain the Client IP address through the server sink, manually configure a table similar to the route table, and select a correct Server IP address through the Client IP address.

We can use trackinghandler to use a correct IP address when Marshal marshalbyrefobject on the server side.

For the implementation method, refer to the article reproduced by Zhang YiArticle: Http://www.cnblogs.com/wayfarer/articles/69104.html

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.