linux - Virtual IP socket communication in mac os -


i experimenting creating multiple ip address same nic hardware of following command in mac os.

ifconfig en0 alias 121.3.3.5 192.168.139.255

ifconfig results following

en0: flags=8863 mtu 1500 options=10b ether 68:5b:35:7e:b0:dc inet6 fe80::6a5b:35ff:fe7e:b0dc%en0 prefixlen 64 scopeid 0x4 inet 192.168.139.191 netmask 0xfffffe00 broadcast 192.168.139.255 inet 121.3.3.5 netmask 0xff000000 broadcast 192.168.139.255 nd6 options=1 media: autoselect (1000baset ) status: active

i ran simple server in machine, tried connecting virtual ip address (121.3.3.5) . able connect,read , write. when tried connect remote server (say ex: imap.gmail.com) not able connect these virtual ip address.. tcp/ip status in

sync_sent state

java code (to set local virtual ip):

inetaddress remoteinet = inetaddress.getbyname("imap.gmail.com");

                inetaddress inet = inetaddress.getbyaddress(new byte[]{(byte)121, (byte)3, (byte)3, (byte)5});                  socket = new socket(remoteinet,993,inet,0); 

so, why not connect remote server virtual address?

p.s: behind nat/ firewall. , can connect nic ip address (read/write).


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -