Skip to content

using SSH2 to connect with multi NIC environment #22410

Closed
@arunvaradharajan

Description

@arunvaradharajan

I have multiple NIC cards in my deployment environment.I will be able to do ssh to resources only using non-default NIC interfaces(eht2, eth3).
I'm using SSH2(https://www.npmjs.com/package/ssh2) Client library to connect to the servers from my nodejs module, by default I see it is using only eth0 interface for connecting. Is there a way i can add options to the SSH2 Client to connect to eth3

my current configuration to connect via SSH2 is as below:

 {
      host: ' 10.0.0.2 ',
      port: '22',
      username: 'root',
      password: 'aaa',
      hostHash: 'md5',
      privateKey: '/path/to/private/key',
 }

.

my ifconfig is as below:

[root@test-5668a3173937 ~]# ifconfig 
eth0 Link encap:Ethernet HWaddr 56:68:A3:17:39:37
inet addr:10.9.20.40 Bcast:10.9.27.255 Mask:255.255.240.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3437260 errors:2777 dropped:0 overruns:0 frame:2777
TX packets:1278164 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000RX bytes:1016474081 (969.3 MiB) TX bytes:557227750 (531.4 MiB)

eth3 Link encap:Ethernet HWaddr 56:68:A3:17:39:3A
inet addr:10.23.24.45 Bcast:172.16.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:58685 errors:126 dropped:0 overruns:0 frame:126
TX packets:36968 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000RX bytes:9270749 (8.8 MiB) TX bytes:5978566 (5.7 MiB)

--

Metadata

Metadata

Assignees

No one assigned

    Labels

    wrong repoIssues that should be opened in another repository.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions