标签:装包 Fix 操作 command 跟踪系统 source unknown rup 查看
[root@centos6-mould ~]# ip addr add 192.168.1.9/24 dev eth0 label eth0:0
[root@centos6-mould ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:94:b7:d0 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.8/24 brd 192.168.1.255 scope global eth0
inet 192.168.1.9/24 scope global secondary eth0:0
inet6 fe80::a00:27ff:fe94:b7d0/64 scope link
valid_lft forever preferred_lft forever
[root@centos6-mould ~]# ip addr delete 192.168.1.9/24 dev eth0
[root@centos6-mould ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:94:b7:d0 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.8/24 brd 192.168.1.255 scope global eth0
inet6 fe80::a00:27ff:fe94:b7d0/64 scope link
valid_lft forever preferred_lft forever
[root@centos6-mould ~]# ip route add 192.168.1.7 via 192.168.1.9 dev eth0:0
[root@centos6-mould ~]# ip route del 192.168.1.7
[root@centos6-mould ~]# ip route
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.8
169.254.0.0/16 dev eth0 scope link metric 1002
default via 192.168.1.1 dev eth0
( dport = :22 )
[root@centos6-mould ~]# ss -np state "listening"
Recv-Q Send-Q Local Address:Port Peer Address:Port
0 128 192.168.1.8:22 *:* users:(("sshd",1347,3))
0 100 ::1:25 :::* users:(("master",1426,13))
0 100 127.0.0.1:25 *:* users:(("master",1426,12))
[root@centos6-mould ~]# ss -np state "established"
Recv-Q Send-Q Local Address:Port Peer Address:Port
0 64 192.168.1.8:22 192.168.1.2:54516 users:(("sshd",1581,3))
[root@centos6-mould ~]# ss -tunlp
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
tcp LISTEN 0 128 192.168.1.8:22 *:* users:(("sshd",1347,3))
tcp LISTEN 0 100 ::1:25 :::* users:(("master",1426,13))
tcp LISTEN 0 100 127.0.0.1:25 *:* users:(("master",1426,12))
[root@centos6-mould ~]# ss -tunap
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
tcp LISTEN 0 128 192.168.1.8:22 *:* users:(("sshd",1347,3))
tcp LISTEN 0 100 ::1:25 :::* users:(("master",1426,13))
tcp LISTEN 0 100 127.0.0.1:25 *:* users:(("master",1426,12))
tcp ESTAB 0 64 192.168.1.8:22 192.168.1.2:54516 users:(("sshd",1581,3))
[root@centos6-mould ~]# ss -tunp
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
tcp ESTAB 0 240 192.168.1.8:22 192.168.1.2:54516 users:(("sshd",1581,3))
[root@centos6-mould ~]# ss -tunap ‘( sport = :22 )‘
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
tcp LISTEN 0 128 192.168.1.8:22 *:* users:(("sshd",1347,3))
tcp ESTAB 0 64 192.168.1.8:22 192.168.1.2:54516 users:(("sshd",1581,3))
3、详细说明进行管理工具htop、vmstat等相关命令,并举例
[root@centos7-mould ~]# vmstat 1 10
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 0 355264 2076 87016 0 0 41 3 43 42 0 0 99 1 0
0 0 0 355264 2076 87016 0 0 0 0 70 60 0 0 100 0 0
0 0 0 355240 2076 87016 0 0 0 0 62 57 0 0 100 0 0
0 0 0 355240 2076 87016 0 0 0 0 56 51 0 0 100 0 0
0 0 0 355240 2076 87016 0 0 0 0 69 61 0 0 100 0 0
0 0 0 355240 2076 87016 0 0 0 0 61 50 0 0 100 0 0
0 0 0 355240 2076 87016 0 0 0 2 75 68 0 0 100 0 0
0 0 0 355240 2076 87016 0 0 0 0 64 50 0 0 100 0 0
0 0 0 355240 2076 87016 0 0 0 0 90 66 0 0 100 0 0
0 0 0 355240 2076 87016 0 0 0 0 59 52 0 0 100 0 0
网段内,地址是否能够ping通,若ping通则输出"success!",若ping不通则输出"fail!"
[root@centos7-mould ~]# cat pingwhile.sh
#!/bin/bash
# description: 测试192.168.0.0/24网段是否能ping通
# author: xuluchuan
# version: 1.0
# date: 20180623
declare -i i=1
while [ $i -le 254 ]; do
ip="192.168.0.$i"
ping -c 3 -w 3 -W 3 $ip &> /dev/null
if [ $? -eq 0 ]; then
echo "ping $ip successful"
else
echo "ping $ip fail"
fi
let i++
done
[root@centos7-mould ~]# cat pinguntil.sh
#!/bin/bash
# description: 测试192.168.0.0/24网段是否能ping通
# author: xuluchuan
# version: 1.0
# date: 20180623
declare -i i=1
until [ $i -gt 254 ]; do
ip="192.168.0.$i"
ping -c 3 -w 3 -W 3 $ip &> /dev/null
if [ $? -eq 0 ]; then
echo "ping $ip successful"
else
echo "ping $ip fail"
fi
let i++
done
标签:装包 Fix 操作 command 跟踪系统 source unknown rup 查看
原文地址:https://www.cnblogs.com/xuluchuan/p/9218728.html