LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-23-2010, 08:49 AM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, Ubuntu, Amazon Linux
Posts: 1,850
Blog Entries: 21

Rep: Reputation: 119Reputation: 119
ssh client can't forward from ::1


The OpenSSH client can handle IPv6 addresses as destinations for the secure connection. But it seems to lack that ability for port forwarding:

Code:
altair/phil /home/phil 17> ssh -p 22222 -L '127.0.0.1:22222:172.30.0.25:22222' phil@172.30.0.21 'whoami'
phil
altair/phil /home/phil 18> ssh -p 22222 -L '[::1]:22222:172.30.0.25:22222' phil@172.30.0.21 'whoami'
channel_setup_fwd_listener: getaddrinfo(::1): Address family for hostname not supported
Could not request local forwarding.
phil
altair/phil /home/phil 19> ping6 -c 5 ::1
PING ::1(::1) 56 data bytes
64 bytes from ::1: icmp_seq=1 ttl=64 time=0.041 ms
64 bytes from ::1: icmp_seq=2 ttl=64 time=0.060 ms
64 bytes from ::1: icmp_seq=3 ttl=64 time=0.060 ms
64 bytes from ::1: icmp_seq=4 ttl=64 time=0.062 ms
64 bytes from ::1: icmp_seq=5 ttl=64 time=0.056 ms

--- ::1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 3996ms
rtt min/avg/max/mdev = 0.041/0.055/0.062/0.012 ms
altair/phil /home/phil 20> ssh -6 -p 22222 -L '[::1]:22222:172.30.0.25:22222' phil@172.30.0.21 'whoami'
ssh: Could not resolve hostname 172.30.0.21: Address family for hostname not supported
altair/phil /home/phil 21>
Is this a case of broken software, or is there a special way to tell OpenSSH an IPv6 address for port forwarding listen binding? The -6 option for the ssh client doesn't have a way to discriminate which address context (e.g. the address to bind for listen vs. the address to connect to for port forwarding vs. the actual secure ssh connection).

Which address class (IPv4 vs. IPv6) an IP address is, is obvious, and I see no reason why some code can't tell the difference. I can see the need for something more, like the -4 and -6 options, when dealing with hostnames that might have both A and AAAA records (to decide which to use or which to try connecting to first). But even then, a prefix to the hostname (like ip4:example.com or ip6:example.net) would be useful to allow mixing IPv4 and IPv6.
 
Old 02-23-2010, 07:17 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.10, Centos 7.3
Posts: 17,537

Rep: Reputation: 2420Reputation: 2420Reputation: 2420Reputation: 2420Reputation: 2420Reputation: 2420Reputation: 2420Reputation: 2420Reputation: 2420Reputation: 2420Reputation: 2420
Check the cfg file ssh_config
Quote:
AddressFamily
Specifies which address family to use when connecting. Valid arguments are ''any'', ''inet'' (use IPv4 only) or ''inet6'' (use IPv6 only).
http://linux.die.net/man/5/ssh_config
 
Old 02-24-2010, 07:52 AM   #3
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, Ubuntu, Amazon Linux
Posts: 1,850
Blog Entries: 21

Original Poster
Rep: Reputation: 119Reputation: 119
Quote:
Originally Posted by chrism01 View Post
Check the cfg file ssh_config

http://linux.die.net/man/5/ssh_config
But this isn't an issue with the address being used for connecting. That (the address used for connecting) works fine, even if I use an IPv6 address, even for the localhost "::1" address. The issue is with the address used to bind a local interface address for listening, the first subargument given to the -L option for port forwarding. It appears that once SSH detects an IPv4 address (as the connecting address), it uses IPv4 for the -L binding, too.

What I need is a way to specify different AddressFamily for different purposes, such as adding new config options AddressFamilyForwardLocalListen, AddressFamilyForwardRemoteListen, AddressFamilyForwardLocalConnect, AddressFamilyForwardRemoteConnect, AddressFamilyConnect, etc. Perhaps a simpler alternative is a prefix for addresses and hostnames to force an address family such as:
Code:
ssh -p 22222 -L 'ip6=[::1]:22222:ip4=172.30.0.25:22222' phil@ip4=172.30.0.21 'whoami'
where valid family expressions would be ip4, ip6, ip46, and ip64.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to setup thin client just for telnet or ssh client use using boot diskless PXE. hocheetiong Linux - Newbie 3 05-21-2008 07:02 PM
Forward OS/X apps over ssh? djeikyb Linux - Software 1 03-25-2008 01:39 AM
SSH X forward firefox Cetko Linux - Networking 6 02-20-2008 01:53 AM
forward ssh serii Linux - Newbie 1 05-01-2005 02:41 PM
Looking for pop3 client and smtp forward HSukirman Linux - Newbie 5 03-30-2004 07:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration