为confd netconf ssh连接设置ipv4和ipv6

时间:2019-07-19 09:36:40

标签: ssh confd netconf

我正在使用6.3版的confd。我正在尝试将其设置为能够通过ipv4和ipv6与netconf一起使用ssh。我的相关配置如下:

  <netconf>
    <enabled>true</enabled>
    <transport>
      <ssh>
        <enabled>true</enabled>
        <ip>::</ip>
        <port>2022</port>
      </ssh>

      <!-- NETCONF over TCP is not standardized, but it can be useful
           during development in order to use e.g. netcat for scripting.
      -->
      <tcp>
        <enabled>true</enabled>
        <ip>127.0.0.1</ip>
        <port>2023</port>
      </tcp>
    </transport>
    ....
</netconf>

导致

root@0eeefd5ae80c:/shared# netstat -ln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
...
tcp6       0      0 :::2022                 :::*                    LISTEN     

当我将ip更改为0.0.0.0时,它将通过ipv4进行监听。但是我无法同时设置ipv4和ipv6。甚至有可能>

1 个答案:

答案 0 :(得分:0)

事实证明,可以使用清单中未描述的参数。因此,可以这样做:

...
  <netconf>
    <enabled>true</enabled>
    <transport>
      <ssh>
        <enabled>true</enabled>
        <ip>0.0.0.0</ip>
        <port>2022</port>
        <extraIpPorts>:::830</extraIpPorts>
      </ssh>
  </netconf>
...