microsoft / omi

Open Management Infrastructure
Other
368 stars 116 forks source link

Add IPv6 support #649

Closed JumpingYang001 closed 4 years ago

JumpingYang001 commented 4 years ago

@microsoft/omi-devs fixes ipv6 doesn't listen on omiserver.

JumpingYang001 commented 4 years ago

@sarojcare how about EnableIPv6=true in omiserver.conf? will do as below.

By Default look for ipv4 if fails try with ipV6.
In case in config it is mentioned to use IPv6 then try binding with IPv6 only else fail gracefully with appropriate message.
JumpingYang001 commented 4 years ago

@sarojcare I tried on only enabled IPv6 box cent6x64testl06, IPv4 listen pass even it doesn't have IPv4 address. so it will not try IPv6. if we follow By Default look for ipv4 if fails try with ipV6.

JumpingYang001 commented 4 years ago

@sarojcare @bbsaurav how about below design? it will keep current IPv4 by default, if someone want to use IPv6 he need to set omiserver.conf. BTW, if IPv4 socket listen on 1270, IPv6 socket seems cannot listen on 1270 due to conflicts. If they use in6addr_any will not have the problem for scenarios "IPv6 only" and "IPv6+IPv4".

By default, enabledIPv6=false in omiserver.conf.

if(enableIPv6)
{
    TryIPv6();
    if(tryFail) TryIPv4();
}
else
{
    TryIPv4();
    if(tryFail) TryIPv6();
}
bbsaurav commented 4 years ago

@sarojcare @bbsaurav how about below design? it will keep current IPv4 by default, if someone want to use IPv6 he need to set omiserver.conf. BTW, if IPv4 socket listen on 1270, IPv6 socket seems cannot listen on 1270 due to conflicts. If they use in6addr_any will not have the problem for scenarios "IPv6 only" and "IPv6+IPv4".

Can you check how sshd listens on port 22 for both IPv4 and IPv6 tcp 0 0 0.0.0.0:22 0.0.0.0: LISTEN 63615/sshd tcp6 0 0 :::22 ::: LISTEN 63615/sshd

For some functionality to work we use ssh communication between MS and monitored device.

By default, enabledIPv6=false in omiserver.conf. if(enableIPv6) { TryIPv6(); if(tryFail) TryIPv4(); } else { TryIPv4(); if(tryFail) TryIPv6(); }

My only concern here is that when we only listen on IPv6 then for IPv4 communication the IPv4 address will be translated into IPv6 address. In most of the recent OS this translation layer is already present. But in older OS this translation layer might not be present. You need to check whether this translation layer is present on all the supported Linux and Unix distros and their versions.

JumpingYang001 commented 4 years ago

@bbsaurav got you, some things need to do:

  1. setup only IPv6 environments on all supported Linux and Unix.
  2. kick off a private on Jenkins.
  3. test if works.
JumpingYang001 commented 4 years ago

Deepak merged #655 , so close this PR.