Finding IPv4 foreign address and disabling IPv6 - SOLVED -
I'm trying to get the IPv4 source address for SSHD connection however netstat is dropping the last octet.
–-
root@node1:~# netstat -taupen | grep 22
tcp6 0 0 :::22 :::* LISTEN 0 1946 1276/sshd
tcp6 0 104 ::ffff:67.18.187.222:22 ::ffff:125.255.80.:3492 ESTABLISHED0 2014 1305/sshd: sharpeg
As I dont need to use IPv6 I tried disabling it (in /etc/modprobe.d/aliases):
alias net-pf-10 ipv6 //Disabled IPv6 20080911
alias net-pf-10 off
alias ipv6 off
Didn't disable IPv6 however checking modules list there is nothing to disable (linode use motholithic kernels):
root@node1:~# lsmod
Module Size Used by
root@node1:~#
So guess I have two questions:
1. is it possible to get a kernel with IPv6 disabled?
2. how to find the IPv4 address of connections to my linode host?
Thanks
2 Replies
After a bit more investigating to the netstat -n truncation of the ip6 address I found an open bug report:
For those that encounter the same thing under Debian Etch you can either:
re-package the a patched net-tools or
install the testing net-tools package which has the patch applied, which is what I did
I can now see the full ip6 address:
–-
root@node1:~# netstat -taupen | grep 22
tcp6 0 0 :::22 :::* LISTEN 0 17027 2516/sshd
tcp6 0 0 67.18.187.222:22 220.239.42.204:1918 ESTABLISHED 0 17111 2543/sshd: sharpeg
tcp6 0 52 67.18.187.222:22 220.239.42.204:1917 ESTABLISHED 0 17035 2518/sshd: sharpeg
---