Linux杂记
ifconfig
ifconfig
是我们最常用的查看当前系统的网卡和 ip 地址信息的命令。如果你的机器上还没安装 ifconfig 命令,可以使用如下命令安装:
sudo apt install net-tools
安装成功以后,我们就可以使用ifconfig
查看机器网卡信息了:
[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.206.140 netmask 255.255.255.0 broadcast 192.168.206.255
inet6 fe80::1599:dcc4:b3e8:7fce prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:ee:01:80 txqueuelen 1000 (Ethernet)
RX packets 1005 bytes 77224 (75.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 349 bytes 47206 (46.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 4 bytes 352 (352.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4 bytes 352 (352.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
上述输出显示了机器当前激活的每个网卡(网络设备)的 ipv4、ipv6 地址、子网掩码、广播地址等信息,这里一共两个网卡,分别是ens33
和lo
。
我们可以使用-s
选项显示网卡信息的精简列表:
[root@localhost ~]# ifconfig -s
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
ens33 1500 1086 0 0 0 379 0 0 0 BMRU
lo 65536 4 0 0 0 4 0 0 0 LRU
默认情况下,ifconfig
命令只会显示激活的网卡信息,如果要显示所有的(包括未激活)的网卡,我们可以使用-a
参数。
如果我们想激活或者禁用某个网卡,可以使用 ifconfig up
和 ifconfig down
命令,用法如下:
ifconfig 网卡名 up
ifconfig 网卡名 down
我们来演示一下:
[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.206.140 netmask 255.255.255.0 broadcast 192.168.206.255
inet6 fe80::1599:dcc4:b3e8:7fce prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:ee:01:80 txqueuelen 1000 (Ethernet)
RX packets 1398 bytes 114269 (111.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 601 bytes 97657 (95.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 12 bytes 1056 (1.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12 bytes 1056 (1.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
## 禁用网卡 lo 后默认只能看到一个网卡信息
[root@localhost ~]# ifconfig lo down
[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.206.140 netmask 255.255.255.0 broadcast 192.168.206.255
inet6 fe80::1599:dcc4:b3e8:7fce prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:ee:01:80 txqueuelen 1000 (Ethernet)
RX packets 1510 bytes 123232 (120.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 657 bytes 104751 (102.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]# ifconfig -a
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.206.140 netmask 255.255.255.0 broadcast 192.168.206.255
inet6 fe80::1599:dcc4:b3e8:7fce prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:ee:01:80 txqueuelen 1000 (Ethernet)
RX packets 1543 bytes 125948 (122.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 675 bytes 107251 (104.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=8<LOOPBACK> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 12 bytes 1056 (1.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12 bytes 1056 (1.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
## 再次启用网卡 lo
[root@localhost ~]# ifconfig lo up
[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.206.140 netmask 255.255.255.0 broadcast 192.168.206.255
inet6 fe80::1599:dcc4:b3e8:7fce prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:ee:01:80 txqueuelen 1000 (Ethernet)
RX packets 1615 bytes 131924 (128.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 715 bytes 112423 (109.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 12 bytes 1056 (1.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12 bytes 1056 (1.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ifconfig 还可以将一个 ip 地址绑定到某个网卡上,或将一个 ip 从某个网卡上解绑,使用如下命令:
ifconfig 网卡名 add ip地址
ifconfig 网卡名 del ip地址
演示如下:
[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.206.140 netmask 255.255.255.0 broadcast 192.168.206.255
inet6 fe80::1599:dcc4:b3e8:7fce prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:ee:01:80 txqueuelen 1000 (Ethernet)
RX packets 1615 bytes 131924 (128.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 715 bytes 112423 (109.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 12 bytes 1056 (1.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12 bytes 1056 (1.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]# ifconfig ens33 add 192.168.206.150
[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.206.140 netmask 255.255.255.0 broadcast 192.168.206.255
inet6 fe80::1599:dcc4:b3e8:7fce prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:ee:01:80 txqueuelen 1000 (Ethernet)
RX packets 1804 bytes 145940 (142.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 781 bytes 119581 (116.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ens33:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.206.150 netmask 255.255.255.0 broadcast 192.168.206.255
ether 00:0c:29:ee:01:80 txqueuelen 1000 (Ethernet)
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 12 bytes 1056 (1.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12 bytes 1056 (1.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
上述操作中,对于网卡 ens33
原来绑定了 ip 地址 192.168.206.140
,我们使用 ifconfig add
命令绑定了一个新的 ip :192.168.206.150
,现在我们可以使用这个新的 ip 地址来访问原来的网络了。
同理,如果要解绑这个 ip,可以按如下操作:
[root@localhost ~]# ifconfig ens33 del 192.168.206.150
[root@localhost ~]# ifconfig -a
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.206.140 netmask 255.255.255.0 broadcast 192.168.206.255
inet6 fe80::1599:dcc4:b3e8:7fce prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:ee:01:80 txqueuelen 1000 (Ethernet)
RX packets 2127 bytes 172321 (168.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 953 bytes 139954 (136.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 18 bytes 1560 (1.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 18 bytes 1560 (1.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
在 Windows 上与 ifconfig
相对应的命令是 ipconfig
,如在 Windows 上查看所有网卡信息可以使用 ipconfig /all
。
ping
ping 命令是我们最常用的命令之一,一般用于侦测本机到目标主机的网络是否通畅。其使用方法是:
ping ip地址
使用方法如下:
[root@localhost ~]# ping 120.55.94.78
PING 120.55.94.78 (120.55.94.78) 56(84) bytes of data.
64 bytes from 120.55.94.78: icmp_seq=1 ttl=128 time=11.0 ms
64 bytes from 120.55.94.78: icmp_seq=2 ttl=128 time=17.3 ms
64 bytes from 120.55.94.78: icmp_seq=3 ttl=128 time=16.2 ms
64 bytes from 120.55.94.78: icmp_seq=4 ttl=128 time=10.6 ms
64 bytes from 120.55.94.78: icmp_seq=5 ttl=128 time=10.2 ms
64 bytes from 120.55.94.78: icmp_seq=6 ttl=128 time=18.7 ms
64 bytes from 120.55.94.78: icmp_seq=7 ttl=128 time=15.8 ms
64 bytes from 120.55.94.78: icmp_seq=8 ttl=128 time=10.8 ms
64 bytes from 120.55.94.78: icmp_seq=9 ttl=128 time=10.8 ms
64 bytes from 120.55.94.78: icmp_seq=10 ttl=128 time=11.5 ms
如果目标网络不可达,ping 命令会一直发送而无输出结果,直到我们按 Ctrl + C 中断,才会统计结果。
[root@localhost ~]# ping 120.55.94.79
PING 120.55.94.79 (120.55.94.79) 56(84) bytes of data.
^C^C
--- 120.55.94.79 ping statistics ---
578 packets transmitted, 0 received, 100% packet loss, time 577119ms
Windows 系统上,这种情况下,ping 命令会返回超时的包数量,而不是一直阻塞。且在 Linux 系统上 ping 命令是一直发送数据包,直到人工主动中断;而 Windows 机器上默认会发送 4 个数据包后停止,如果想一直发送而不停止,可以使用 -t 选项。
当然,ping 命令的目标也可以是一个域名,这样通过 ping 这个域名,我们可以得到这个域名解析后的 ip 地址:
[root@localhost ~]# ping www.baidu.com
PING www.a.shifen.com (61.135.169.121) 56(84) bytes of data.
64 bytes from 61.135.169.121 (61.135.169.121): icmp_seq=1 ttl=128 time=30.3 ms
64 bytes from 61.135.169.121 (61.135.169.121): icmp_seq=2 ttl=128 time=28.8 ms
64 bytes from 61.135.169.121 (61.135.169.121): icmp_seq=3 ttl=128 time=29.0 ms
64 bytes from 61.135.169.121 (61.135.169.121): icmp_seq=4 ttl=128 time=31.9 ms
64 bytes from 61.135.169.121 (61.135.169.121): icmp_seq=5 ttl=128 time=28.8 ms
64 bytes from 61.135.169.121 (61.135.169.121): icmp_seq=6 ttl=128 time=27.8 ms
64 bytes from 61.135.169.121 (61.135.169.121): icmp_seq=7 ttl=128 time=29.0 ms
^C
--- www.a.shifen.com ping statistics ---
7 packets transmitted, 7 received, 0% packet loss, time 6011ms
rtt min/avg/max/mdev = 27.822/29.430/31.968/1.244 ms
我们这里得到 www.baidu.com 对应的 ip 地址是 61.135.169.121。
ping 命令是通过发送 ICMP 数据包来实现的。
telnet
telnet
命令是我们最常用的网络调试命令之一。如果你的机器上还没有安装 telnet
命令,可以使用如下命令安装一下:
sudo apt install telnet
如果一个服务程序对外开启了侦听服务,我们都可以使用 telnet ip port
来连接上去,例如:
[root@localhost ~]# telnet 120.55.94.78 8888
Trying 120.55.94.78...
Connected to 120.55.94.78.
Escape character is '^]'.
如果不指定端口号,telnet 会使用默认 23 号端口。
反过来说,可以通过 telnet 命令去检测指定 ip 地址和端口号的侦听服务是否存在。知道这点很重要,我们可以利用这个去检测一个服务是否可以正常连接。举个例子,比如某次从某处得到一个代码下载地址,这是一个 svn 地址:svn://120.55.94.78/mycode/mybook
。为了检测这个 svn 服务是否还能正常对外服务,我们可以先用 ping 命令去检测一下到达这个 ip:120.55.94.78 的网络是否畅通:
[root@localhost ~]# ping 120.55.94.78
PING 120.55.94.78 (120.55.94.78) 56(84) bytes of data.
64 bytes from 120.55.94.78: icmp_seq=1 ttl=128 time=15.3 ms
64 bytes from 120.55.94.78: icmp_seq=2 ttl=128 time=14.3 ms
64 bytes from 120.55.94.78: icmp_seq=3 ttl=128 time=16.4 ms
64 bytes from 120.55.94.78: icmp_seq=4 ttl=128 time=16.1 ms
64 bytes from 120.55.94.78: icmp_seq=5 ttl=128 time=15.5 ms
^C
--- 120.55.94.78 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4007ms
rtt min/avg/max/mdev = 14.343/15.568/16.443/0.723 ms
如果网络畅通,我们再用 telnet 去连接上去,由于 svn 服务器使用的默认端口是 3690,我们执行如下命令:
[root@localhost ~]# telnet 120.55.94.78 3690
Trying 120.55.94.78...
Connected to 120.55.94.78.
Escape character is '^]'.
( success ( 2 2 ( ) ( edit-pipeline svndiff1 absent-entries commit-revprops depth log-revprops atomic-revprops partial-replay ) ) )
如上所示,证明这个 svn 服务是正常开启对外服务的。反之,如果 telnet 命令连不上,说明这个服务不能被外部网络正常连接,我们就没必要去做进一步的尝试了。
同样的道理,对于一个 Web 服务,如 baidu.com,由于我们平常都可以通过 www.baidu.com 去访问百度的页面,Web 服务器默认的端口号是 80,我们使用 telnet www.baidu.com 80 应该也可以连接成功的:
[root@localhost ~]# telnet www.baidu.com 80
Trying 115.239.211.112...
Connected to www.baidu.com.
Escape character is '^]'.
hello
HTTP/1.1 400 Bad Request
Connection closed by foreign host.
我们使用 telnet 命令连接上以后,我们随意发送了一个 hello 消息,由于是非法的 http 请求,被服务器关闭了连接。
telnet 命令不仅可以连接某个服务器,还能与服务器进行交互,这通常用于操作一些接受纯文本数据的服务器程序,如 FTP 服务、邮件服务等等。为了演示如何利用 telnet 命令收发数据,我们这里利用 telnet 命令来模拟给某个邮箱发送一封邮件,发送邮件我们通常使用的是 SMTP 协议,该协议默认使用的端口为 25。
假设我们的发件地址是:amass_toolset@163.com,收件地址是:168062547@qq.com。
其中发件地址是一个 163 邮箱,如果你没有的话可以去申请一个,申请后进入邮箱,在设置页面获得网易邮箱的 smtp 服务的服务器地址:
我们得到的地址 smtp 地址是 smtp.163.com
,端口号是 25。
同时,我们 需要开启客户端授权,设置一个客户端授权码:
我们这里将授权码设置为helloword
。
早些年很多邮件服务器允许在其他客户端登陆只需要输入正确的邮件服务器地址、用户名和密码就可以了,后来出于安全考虑,很多邮箱采用了授权码机制,在其他第三方客户端登陆该邮箱时需要输入授权码(不是密码),且需要用户主动打开允许第三方客户端登陆的配置选项。
配置完成以后,我们现在就可以利用 telnet 命令连接 163 邮件服务器并发送邮件了,由于在登陆的过程中需要验证用户名和授权码,而且用户名和授权码必须使用 base64 编码之后的,我们先将用户名和授权码的 base64 码准备好,用的时候直接拷贝过去:
原文 | base64 码 |
---|---|
amass_toolset | YW1hc3NfdG9vbHNldA== |
helloword | aGVsbG93b3Jk |
在整个演示过程我们一共需要使用如下 SMTP 协议命令:
命令 | 含义 |
---|---|
helo | 向 smtp 服务器发送问候信息 |
auth login | 请求登陆验证 |
data | 请求输入邮件正文 |
SMTP 协议 是文本协议,每一个数据包以 \r\n 结束(Windows 系统下默认换行符)。
我们来看一下演示过程:
[root@localhost ~]# telnet smtp.163.com 25
Trying 220.181.12.14...
Connected to smtp.163.com.
Escape character is '^]'.
220 163.com Anti-spam GT for Coremail System (163com[20141201])
helo 163.com
250 OK
auth login
334 dXNlcm5hbWU6
YW1hc3NfdG9vbHNldA==
334 UGFzc3dvcmQ6
aGVsbG93b3Jk
235 Authentication successful
mail from: <amass_toolset@163.com>
250 Mail OK
rcpt to: <168062547@qq.com>
250 Mail OK
data
354 End data with <CR><LF>.<CR><LF>
from:amass_toolset@163.com
to: 168062547@qq.com
subject: Test
Hello, this is a message from 163.
.
250 Mail OK queued as smtp10,DsCowADHAgQS1IBcwtExJA--.62308S2 1551946998
Connection closed by foreign host.
[root@localhost ~]#
我们来分析一下上述操作过程:
-
使用
telnet smtp.163.com 25
连接 163 邮件服务器;连接成功以后,服务器给我们发送了一条欢迎消息:220 163.com Anti-spam GT for Coremail System (163com[20141201])\r\n
-
接着,必须向服务器发送一条问候消息,使用
helo 163.com
,当然 163.com 这个是问候内容,可以随意填写,然后回车,最终组成的数据包内容是:helo 163.com\r\n
-
接着服务器会回复一条状态码是 250 的消息,这里是:
250 OK\r\n
-
我们再输入命令
auth login
请求验证,然后按回车,实际发送给服务器的是:auth login\r\n
-
服务器应答状态码 334:
334 dXNlcm5hbWU6\r\n
dXNlcm5hbWU6
是字符串username:
的 base64 码。 -
我们输入我们的用户名
amass_toolset
的 base64 码,然后按回车:YW1hc3NfdG9vbHNldA==\r\n
-
服务器应答状态码 334:
334 UGFzc3dvcmQ6\r\n
UGFzc3dvcmQ6
是字符串Password:
的 base64 码。这里实际上要求我们输入的是上文介绍的授权码,而不是密码。 -
我们输入
aGVsbG93b3Jk
,并回车:aGVsbG93b3Jk\r\n
服务器提示我们授权成功(应答状态码 235):
235 Authentication successful\r\n
-
接着输入邮件的发件地址和收件地址,服务器也会给我们响应的应答(应答状态码 250):
mail from: <amass_toolset@163.com>\r\n
250 Mail OK\r\n
rcpt to: <168062547@qq.com>\r\n
250 Mail OK\r\n -
接着输入 data 命令设置邮件的主题、正文、对方收到邮件后显示的的发件人信息等:
data\r\n
354 End data with <CR><LF>.<CR><LF>服务器应答 354,并且提示,如果确定结束输入邮件正文就先按一个回车键,再输入一个点 .,再接着回车,这样邮件就发送出去了。
-
服务器应答 250:
250 Mail OK queued as smtp13,EcCowABnm_zPy7Vhg6x6Bw--.23648S2 1639304268
-
如果我们想退出,输入 quit 或 close 都可以。
最终,这封邮件就发出去了,我们去168062547@qq.com 这个邮箱查看一下:
如果你在实际实验时,对端没有收到邮件,请查看下你的垃圾箱或者邮箱反垃圾邮件设置,有可能被邮箱反垃圾邮件机制给拦截了。
上述在组装 SMTP 协议包时涉及到很多状态码,常见的 SMTP 状态码含义如下:
211 帮助返回系统状态
214 帮助信息
220 服务准备就绪
221 关闭连接
235 用户验证成功
250 请求操作就绪
251 用户不在本地,转寄到其他路径
334 等待用户输入验证信息
354 开始邮件输入
421 服务不可用
450 操作未执行,邮箱忙
451 操作中止,本地错误
452 操作未执行,存储空间不足
500 命令不可识别或语言错误
501 参数语法错误
502 命令不支技
503 命令顺序错误
504 命令参数不支持
550 操作未执行,邮箱不可用
551 非本地用户
552 中止存储空间不足
553 操作未执行,邮箱名不正确
554 传输失败
由于我们使用的开发机器以 Windows 居多,默认情况下,Windows 系统的 telnet 命令是没有开启的,我们可以在【控制面板】- 【程序】- 【程序和功能】- 【打开或关闭Windows功能】中打开telnet功能。如下图所示:
netstat
无论是 Windows 和 Linux 都提供了 netstat 命令,这个命令是我们使用的较多的查看网络连接状态的命令。这里以 Linux 系统为例,其常见选项有:
-a (all)显示所有选项,netstat 默认不显示 LISTEN 相关。
-t (tcp)仅显示 tcp 相关选项
-u (udp)仅显示 udp 相关选项
-n 不显示别名,能显示数字的全部转化成数字
-l 仅列出有在 Listen (监听) 的服務状态
-p 显示建立相关链接的程序名
-r 显示路由信息,路由表
-e 显示扩展信息,例如uid等
-s 按各个协议进行统计 (重要)
-c 每隔一个固定时间,执行该 netstat 命令。
我们来详细介绍一下 -n 选项,默认情况下,对于一些有别名的 ip 地址和端口号 netstat 会以其别名来显示,例如 127.0.0.1 会显示成 localhost,80 端口会显示成 http。如下所示:
[root@iZ238vnojlyZ ~]# netstat -at
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:svn 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:http 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:ddi-tcp-1 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:italk 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:dnp 0.0.0.0:* LISTEN
tcp 0 0 localhost:32000 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:commtact-http 0.0.0.0:* LISTEN
tcp 0 404 iZ238vnojlyZ:ssh 101.224.250.233:57844 ESTABLISHED
tcp 0 0 iZ238vnojlyZ:59520 100.100.45.131:http ESTABLISHED
tcp 0 0 localhost:32000 localhost:31000 ESTABLISHED
tcp6 0 0 [::]:mysql [::]:* LISTEN
tcp6 0 0 [::]:ftp [::]:* LISTEN
tcp6 0 0 localhost:31000 localhost:32000 ESTABLISHED