# Issues using "tcp46" socket for telnet service



## sudharshan (Mar 14, 2013)

Hi everyone,
I'm facing issues trying to use tcp46 socket for telnet / SSH service. If I set the flag to IPV4 or disable IPV6 flag, in "xinetd", I can connect. But, if I set the xinetd flag to IPV6, I can not connect to the system.

Looking into how the "xinetd" understands the flags, it looks like when flags are set IPV4, we are limited to use IPV4 to use the service. Similar is the case if we set flags to IPv6. Is this true? Please correct me if my understanding is not right here. 

My question: When we want to use single socket to both use v4 and v6 address, like tcp46, should we have to enable "ipv4mappedipv6" address in the system, so that even if we set xinetd's Flag to "IPV6", we can still use them? Does this sound right? 

Waiting for some inputs..


----------



## SirDice (Mar 14, 2013)

FreeBSD doesn't have xinitd. Are you asking a Linux question? Please find a Linux forum for it.


----------



## DutchDaemon (Mar 14, 2013)

*i* -> *e* 

We do have security/xinetd though, but why would anyone used (x)inetd anymore?


----------



## sudharshan (Mar 15, 2013)

Thanks SirDice and DutchDaemon. Yes, I was referring to xinetd as DutchDaemon mentions it here. 
Is it true that we need to use separate tcp4  and tcp6 socket instead of using a single tcp46 socket?


----------



## SirDice (Mar 15, 2013)

Simply don't use it, you really don't need it. Don't use it for telnet, don't use telnet at all. And sshd(8) runs as a daemon.

Still doesn't quite answer the question though, is this on FreeBSD?


----------



## sudharshan (Mar 15, 2013)

SirDice, Yes this is on FreeBSD. In a general sense, how can we make 'ssh' via both ipv4/ipv6 address? 
'sshd' with 
-4      Forces sshd to use IPv4 addresses only.
-6      Forces sshd to use IPv6 addresses only.
Thanks


----------



## SirDice (Mar 15, 2013)

sudharshan said:
			
		

> In a general sense, how can we make 'ssh' via both ipv4/ipv6 address?


It does so by default. There's no need for any switches. If you want to bind sshd(8) to specific addresses you need to edit /etc/ssh/sshd_config:

```
ListenAddress 1.2.3.4
ListenAddress 2001:aaaa:bbbb:cccc::1
```


----------



## sudharshan (Mar 15, 2013)

Great! Thanks SirDice. May be a lame question.. but just to make sure, you mean that setting listening address in /etc/ssh/sshd_config to something like this below, allow all v4 and v6 address?

```
ListenAddress 0.0.0.0
ListenAddress ::0/0
```


----------



## SirDice (Mar 15, 2013)

sudharshan said:
			
		

> May be a lame question.. but just to make sure, you mean that setting listening address in "/etc/ssh/sshd_config" to something like this below, allow all v4 and v6 address?


It will do that by default, no need to set anything.


----------



## sudharshan (Mar 15, 2013)

Thanks SirDice again.


----------

