inux怎么做路由跟踪_linux使用traceroute命令追踪路由
Linux有一个基础的路由追踪软件:traceroute。# CentOS系统:
yum update && yum install traceroute -y
# Debian/Ubuntu系统:
apt-get update && apt-get install traceroute -y
然后就可以通过 traceroute x.x.x.x 来路由追踪了。
默认是测试3次的,所以有时候会显示很乱,你可以加上 -q 1 ,比如 traceroute -q 1 x.x.x.x 。
这个参数指的是只测试一次,当然之所以测试3次就为因为可能会丢包等情况,三次可以比较准确。
使用效果:root@doub.io:~/# traceroute -q 1 14.215.116.1
电信;traceroute -q 1 219.149.135.188
联通;traceroute -q 1 202.99.192.66
移动;traceroute -q 1 211.138.106.3
traceroute to 14.215.116.1 (14.215.116.1), 30 hops max, 60 byte packets
1 *
2 192.254.84.149 (192.254.84.149) 1.830 ms
3 te-0-1-0-2.cr1.lax2.us.zenlayer.net (192.254.81.141) 3.740 ms
4 218.30.48.173 (218.30.48.173) 1.374 ms
5 59.43.182.102 (59.43.182.102) 160.245 ms
6 59.43.182.102 (59.43.182.102) 158.658 ms
7 202.97.91.217 (202.97.91.217) 158.070 ms
8 202.97.91.217 (202.97.91.217) 157.866 ms
9 183.61.221.61 (183.61.221.61) 157.841 ms
10 183.56.128.14 (183.56.128.14) 158.043 ms
11 183.56.128.14 (183.56.128.14) 158.236 ms
12 14.215.116.1 (14.215.116.1) 155.918 ms
当然,这个只会显示简单的路由追踪信息。
如果你想要在每个路由信息后面加上对应的地址信息,那么你就需要使用其他的路由追踪软件:
nali-ipip、BestTrace(ipip.net开发),这两个使用的都是 ipip.net 的IP地址库。
最近使用Debian搭建CS服务器,安装各种命令包遇见一些问题,一般是依赖错误、安装目录已存在其他文件(可能是同类的命令包存放相同位置导致的)
我的环境:Debian9
我遇到的问题是为python3环境安装pip3产生的报错,当时我想了一个暴力的解决方法,直接下载pip安装包本地解压安装,当时解决了这个问题 ,但是我再装别的命令包就会有以下报错:
The following packages have unmet dependencies:
bsdmainutils : Depends: bsdextrautils (>= 2.35.2-7) but it is not going to be installed
E: Unmet dependencies. Try ‘apt –fix-broken install’ with no packages (or specify a solution).
1
2
|
dpkg: error processing archive /var/cache/apt/archives/bsdextrautils_2.36-3+b1_amd64.deb (--unpack): trying to overwrite '/usr/share/bash-completion/completions/hexdump' , which is also in package bash-completion 1:2.1-4.3 |
结合这篇文章大体明白了自己的问题可能就是之前装bsdmainutils命令包没装完,存在目录上的一些问题:然后使用文章中的方法步骤,找到出错的命令包位置,使用以下指令:
1
2
3
4
5
6
7
8
9
10
11
12
|
root@fish2:~# dpkg -i --force-overwrite /var/cache/apt/archives/bsdextrautils_2.36-3+b1_amd64.deb (Reading database ... 117779 files and directories currently installed.) Preparing to unpack .../bsdextrautils_2.36-3+b1_amd64.deb ... Unpacking bsdextrautils (2.36-3+b1) ... dpkg: warning: overriding problem because --force enabled: //警告无报错 dpkg: warning: trying to overwrite '/usr/share/bash-completion/completions/hexdump' , which is also in package bash-completion 1:2.1-4.3 dpkg: warning: overriding problem because --force enabled: dpkg: warning: trying to overwrite '/usr/share/bash-completion/completions/look' , which is also in package bash-completion 1:2.1-4.3 Setting up bsdextrautils (2.36-3+b1) ... update-alternatives: warning: alternative /usr/bin/bsd-write (part of link group write) doesn't exist; removing from list of alternatives update-alternatives: warning: /etc/alternatives/write is dangling; it will be updated with best choice update-alternatives: using /usr/bin/write.ul to provide /usr/bin/write (write) in auto mode |
接着这样:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
root@fish2:~# apt-get install -f Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2 libdrm-radeon1 libisl22 libllvm3.9 libpciaccess0 libruby2.3 libtxc-dxtn-s2tc libzstd1 ruby-did-you-mean ruby2.3 Use 'apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 588 not upgraded. 8 not fully installed or removed. After this operation, 0 B of additional disk space will be used. apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct! perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LANG = "zh_CN.UTF-8" are supported and installed on your system . perl: warning: Falling back to the standard locale ( "C" ). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_MESSAGES to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory Processing triggers for cracklib-runtime (2.9.2-5) ... Setting up libmpfr6:amd64 (4.1.0-3) ... Setting up libzstd1:amd64 (1.4.5+dfsg-4) ... Setting up ncal (12.1.7) ... Setting up libbsd0:amd64 (0.10.0-1) ... Setting up calendar (12.1.7) ... Processing triggers for libc-bin (2.31-3) ... Setting up libmpc3:amd64 (1.2.0-1) ... Setting up libisl22:amd64 (0.22.1-1) ... Setting up bsdmainutils (12.1.7) ... Processing triggers for man-db (2.7.6.1-2) ... Processing triggers for libc-bin (2.31-3) ... |
然后再用apt-get install python-pip 命令包 就可以了