Specifying the source IP address for SSH packets

As a best practice, specify the IP address of a loopback or dialer interface as the source IP address of SSH packets for the following purposes:

To specify the source IP address for SSH packets:

Step

Command

Remarks

1. Enter system view.

system-view

N/A

2. Specify the source address for SSH packets.

  • Specify the source IPv4 address for SSH packets:ssh client source { interface interface-type interface-number | ip ip-address }

  • Specify the source IPv6 address for SSH packets:ssh client ipv6 source { interface interface-type interface-number | ipv6 ipv6-address }

By default, the source IP address for SSH packets is not configured. For IPv4 SSH packets, the device uses the primary IPv4 address of the output interface specified in the routing entry as the source address of the packets. For IPv6 SSH packets, the device automatically selects an IPv6 address as the source address of the packets in compliance with RFC 3484.