[root@centos7 ~]# ping -c 3 www.baidu.com PING www.a.shifen.com (61.135.169.121) 56(84) bytes of data. 64 bytes from 61.135.169.121: icmp_seq=1 ttl=52 time=1.35 ms 64 bytes from 61.135.169.121: icmp_seq=2 ttl=52 time=1.32 ms 64 bytes from 61.135.169.121: icmp_seq=3 ttl=52 time=1.22 ms --- www.a.shifen.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2003ms rtt min/avg/max/mdev = 1.225/1.303/1.359/0.064 ms
[root@centos7 ~]# ping www.a.com ping: unknown host www.a.com
[root@centos7 ~]# ping 192.168.0.1 PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data. ^C #这里按CTRL+C键手动终止了进程 --- 192.168.0.1 ping statistics --- 6 packets transmitted, 0 received, 100% packet loss, time 4999ms
[root@centos7 ~]# ping -c2 10.0.1.2 PING 10.0.1.2 (10.0.1.2) 56(84) bytes of data. From 10.0.1.254 icmp_seq=1 Destination Host Unreachable From 10.0.1.254 icmp_seq=2 Destination Host Unreachable --- 10.0.1.2 ping statistics --- 2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 999ms pipe 2
[root@centos7 temp]# hostname centos7 [root@centos7 temp]#
[root@centos7 temp]# hostname NAME [root@centos7 temp]# hostname NAME
[root@centos7 temp]# host www.baidu.com www.baidu.com is an alias for www.a.shifen.com. www.a.shifen.com has address 61.135.169.121 www.a.shifen.com has address 61.135.169.125
[root@centos7 ~]# dig www.baidu.com ; <<>> DiG 9.9.4-RedHat-9.9.4-29.el7_2.2 <<>> www.baidu.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 22125 ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 0 ;; QUESTION SECTION: ;www.baidu.com. IN A ;; ANSWER SECTION: www.baidu.com. 113 IN CNAME www.a.shifen.com. www.a.shifen.com. 113 IN A 61.135.169.125 www.a.shifen.com. 113 IN A 61.135.169.121 ;; Query time: 2 msec ;; SERVER: 223.5.5.5#53(223.5.5.5) ;; WHEN: 四 11月 10 12:31:20 CST 2016 ;; MSG SIZE rcvd: 90 [root@centos7 ~]#
[root@centos7 ~]# dig www.baidu.com A +short www.a.shifen.com. 61.135.169.125 61.135.169.121 [root@centos7 ~]#
[root@centos7 ~]# dig +nocmd www.baidu.com A +noall +answer www.baidu.com. 252 IN CNAME www.a.shifen.com. www.a.shifen.com. 252 IN A 61.135.169.125 www.a.shifen.com. 252 IN A 61.135.169.121
[root@centos7 ~]# dig +noall +answer www.baidu.com A @8.8.8.8 www.baidu.com. 21 IN CNAME www.a.shifen.com. www.a.shifen.com. 263 IN A 61.135.169.125 www.a.shifen.com. 263 IN A 61.135.169.121
[root@centos7 ~]# tracepath www.baidu.com 1?: [LOCALHOST] pmtu 1500 1: 10.0.1.103 0.396ms 1: 10.0.1.103 0.350ms 2: 210.51.161.1 1.187ms asymm 3 3: 210.51.161.1 8.186ms 4: 210.51.175.81 1.117ms 5: 61.148.142.61 8.554ms asymm 12 6: 61.148.147.13 1.694ms asymm 12 7: 123.126.8.117 3.934ms asymm 10 8: 61.148.155.46 2.703ms asymm 10 ....
[root@centos7 ~]# ifconfig ens32: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.20.71.254 netmask 255.255.255.0 broadcast 172.20.71.255 inet6 fe80::250:56ff:fea4:fe34 prefixlen 64 scopeid 0x20<link> ether 00:50:56:a4:fe:34 txqueuelen 1000 (Ethernet) RX packets 11996157 bytes 775368588 (739.4 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 12 bytes 888 (888.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.0.1.254 netmask 255.255.255.0 broadcast 10.0.1.255 inet6 fe80::250:56ff:fea4:a09 prefixlen 64 scopeid 0x20 ether 00:50:56:a4:0a:09 txqueuelen 1000 (Ethernet) RX packets 20941185 bytes 1307830447 (1.2 GiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 147552 bytes 11833605 (11.2 MiB) 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 loop txqueuelen 1 (Local Loopback) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 [root@centos7 ~]#
[root@idc-v-71253 ~]# ifconfig -s ens32 Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg ens32 1500 11996951 0 0 0 12 0 0 0 BMRU
[root@centos7 ~]# ifconfig ens33:0 10.0.1.4/24 up [root@centos7 ~]# ifconfig ens33:0 ens33:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 10.0.1.4 netmask 255.255.255.0 broadcast 10.0.1.255 ether 00:50:56:a4:0a:09 txqueuelen 1000 (Ethernet)
[root@idc-v-71253 ~]# arp -a ? (10.0.1.1) at 68:8f:84:01:f1:ff [ether] on ens33 ? (10.0.1.102) at 00:50:56:a4:18:9a [ether] on ens33 ? (10.0.1.254) at 00:50:56:a4:a9:16 [ether] on ens33 ? (10.0.1.10) at 00:50:56:a4:d2:e4 [ether] on ens33 ? (10.0.1.104) at 00:50:56:a4:37:a7 [ether] on ens33
[root@centos7 ~]# arping 10.0.1.252 -I ens33 ARPING 10.0.1.252 from 10.0.1.254 ens33 Unicast reply from 10.0.1.252 [00:50:56:A4:65:71] 0.843ms Unicast reply from 10.0.1.252 [00:50:56:A4:0A:09] 1.034ms
[root@centos7 ~]# arping -c3 -I ens33 -s 10.0.1.254 10.0.1.1 ARPING 10.0.1.1 from 10.0.1.254 ens33 Unicast reply from 10.0.1.1 [68:8F:84:01:F1:FF] 19.466ms Unicast reply from 10.0.1.1 [68:8F:84:01:F1:FF] 2.358ms Unicast reply from 10.0.1.1 [68:8F:84:01:F1:FF] 24.305ms Sent 3 probes (1 broadcast(s)) Received 3 response(s)
[root@centos7 ~]# route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 ens33 link-local 0.0.0.0 255.255.0.0 U 1002 0 0 ens32 link-local 0.0.0.0 255.255.0.0 U 1003 0 0 ens33 172.20.71.0 0.0.0.0 255.255.255.0 U 0 0 0 ens32 192.168.78.0 10.0.1.104 255.255.255.0 UG 0 0 0 ens33
[root@centos7 ~]# telnet 10.0.1.251 80 Trying 10.0.1.251... Connected to 10.0.1.251. Escape character is '^]'. ^] #这里按了CTRL+],也可以按CTRL+C强行退出。 telnet> quit Connection closed.
[root@centos7 ~]# telnet 10.0.1.251 81 Trying 10.0.1.251... telnet: connect to address 10.0.1.251: No route to host
[root@centos7 ~]# telnet 10.0.1.251 8085 Trying 10.0.1.251... telnet: connect to address 10.0.1.251: Connection refused
[root@centos7 ~]# ssh 10.0.1.253 The authenticity of host '10.0.1.253 (10.0.1.253)' can't be established. ECDSA key fingerprint is 96:bd:a3:a7:87:09:1b:53:44:4c:9b:b9:5f:b2:97:89. Are you sure you want to continue connecting (yes/no)? yes #这里输入yes Warning: Permanently added '10.0.1.253' (ECDSA) to the list of known hosts. root@10.0.1.253's password: #这里输入密码 Last login: Fri Nov 11 09:04:01 2016 from 192.168.78.137 [root@idc-v-71253 ~]# #已登录
[root@centos7 ~]# ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): #回车 Enter passphrase (empty for no passphrase): #回车 Enter same passphrase again: #回车 Your identification has been saved in /root/.ssh/id_rsa. #私钥 Your public key has been saved in /root/.ssh/id_rsa.pub. #公钥 The key fingerprint is: be:c3:d0:02:50:35:35:fe:60:d6:2f:26:96:f0:e1:e6 root@centos7 The key's randomart image is: +--[ RSA 2048]----+ | ...o.o | | . o o | | . . * . | | . * = . | | . .S + . | | o=.o . | | +E | | o. | | .. | +-----------------+ [root@centos7 ~]# [root@centos7 ~]# ssh-copy-id 10.0.1.253 /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys root@10.0.1.253's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh '10.0.1.253'" and check to make sure that only the key(s) you wanted were added. [root@centos7 ~]#
[root@centos7 ~]# ssh 10.0.1.253 Last login: Fri Nov 11 11:08:37 2016 from 10.0.1.254 [root@idc-v-71253 ~]#
[root@centos7 ~]# ssh 10.0.1.252 "hostname" root@10.0.1.252's password: #输入密码 idc-v-71252 #显示命令结果 [root@centos7 ~]# #并不登录
[root@centos7 ~]# cat /root/.ssh/id_rsa.pub | ssh 10.0.1.252 "cat - >> /root/.ssh/authorized_keys" root@10.0.1.252's password: #输入密码 [root@centos7 ~]# ssh 10.0.1.252 #免密登录 Last login: Thu Nov 10 14:42:11 2016 from 192.168.78.135 [root@idc-v-71252 ~]#
[root@centos7 temp]# ssh -p22 10.0.1.252 Last login: Fri Nov 11 11:44:31 2016 from 10.0.1.254 [root@idc-v-71252 ~]#
tar zc /home/temp | ssh user@host "tar xz" #本地temp目录备份到远程 ssh user@host "tar cz /home/temp" | tar xz #远程temp目录备份到本地
[root@centos7 ~]# ssh -L 2222:10.0.1.252:22 10.0.1.253 Last login: Mon Nov 14 10:34:43 2016 from 10.0.1.254 [root@idc-v-71253 ~]# #注意如果这里exit断开连接,则此转发也将终止。
[root@centos7 ~]# ssh -p 2222 127.0.0.1 Last login: Mon Nov 14 10:34:56 2016 from 10.0.1.253 [root@idc-v-71252 ~]#
[root@centos7 ~]# ssh -N -L 2222:10.0.1.252:22 10.0.1.253 & [1] 12432 [root@centos7 ~]#
[root@centos7 ~]# ssh -p 2222 localhost Last login: Mon Nov 14 10:40:44 2016 from 10.0.1.253 [root@idc-v-71252 ~]#
[root@centos7 ~]# scp root@10.0.1.251:/root/a.txt ./ root@10.0.1.251's password: a.txt 100% 125 0.1KB/s 00:00 [root@centos7 ~]#
[root@centos7 ~]# netstat -a Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN tcp 0 0 localhost:smtp 0.0.0.0:* LISTEN tcp 0 52 10.0.1.254:ssh 192.168.78.143:49583 ESTABLISHED tcp6 0 0 [::]:commplex-main [::]:* LISTEN tcp6 0 0 [::]:4243 [::]:* LISTEN tcp6 0 0 [::]:ssh [::]:* LISTEN tcp6 0 0 localhost:smtp [::]:* LISTEN raw6 0 0 [::]:ipv6-icmp [::]:* 7 raw6 0 0 [::]:ipv6-icmp [::]:* 7 Active UNIX domain sockets (servers and established) Proto RefCnt Flags Type State I-Node Path unix 2 [ ACC ] STREAM LISTENING 12807 /run/systemd/private unix 2 [ ACC ] STREAM LISTENING 12815 /run/lvm/lvmpolld.socket unix 2 [ ] DGRAM 12818 /run/systemd/shutdownd unix 2 [ ACC ] STREAM LISTENING 16403 /var/run/dbus/system_bus_socket ....
[root@centos7 ~]# netstat -antp Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1358/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2162/master tcp 0 52 10.0.1.254:22 192.168.78.143:49583 ESTABLISHED 12044/sshd: root@pt tcp6 0 0 :::5000 :::* LISTEN 17222/docker-proxy tcp6 0 0 :::4243 :::* LISTEN 16983/docker tcp6 0 0 :::22 :::* LISTEN 1358/sshd tcp6 0 0 ::1:25 :::* LISTEN 2162/master [root@centos7 ~]#
[root@centos7 ~]# netstat -ntl Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN tcp6 0 0 :::5000 :::* LISTEN tcp6 0 0 :::4243 :::* LISTEN tcp6 0 0 :::22 :::* LISTEN tcp6 0 0 ::1:25 :::* LISTEN [root@centos7 ~]#
[root@centos7 ~]# netstat -r Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface default 10.0.1.103 0.0.0.0 UG 0 0 0 ens33 10.0.1.0 0.0.0.0 255.255.255.0 U 0 0 0 ens33 172.20.71.0 0.0.0.0 255.255.255.0 U 0 0 0 ens32 192.168.78.0 10.0.1.104 255.255.255.0 UG 0 0 0 ens33
[root@centos7 ~]# netstat -i Kernel Interface table Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg ens32 1500 13196107 0 77 0 3246 0 0 0 BMRU ens33 1500 25312388 0 88 0 2516050 0 0 0 BMRU lo 65536 2503589 0 0 0 2503589 0 0 0 LRU
[root@idc-v-71253 ~]# tcpdump -i ens33 tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on ens33, link-type EN10MB (Ethernet), capture size 65535 bytes 15:41:59.121948 IP 10.0.1.108.3693 > 239.100.1.1.websm: UDP, length 58 15:41:59.122191 IP 10.0.1.109.35673 > 239.100.1.1.websm: UDP, length 57 15:41:59.128282 IP 10.0.1.253.ssh > 192.168.78.143.51694: Flags [P.], seq 749565300:749565496, ack 3522345564, win 255, length 196 15:41:59.134127 IP 192.168.78.143.51694 > 10.0.1.253.ssh: Flags [.], ack 196, win 3977, length 0 15:41:59.140319 ARP, Request who-has 10.0.1.31 tell 10.0.1.102, length 46 15:41:59.168328 ARP, Request who-has 10.0.1.37 tell 10.0.1.102, length 46 15:41:59.262235 ARP, Request who-has 192.168.10.150 tell 192.168.10.151, length 46 15:41:59.622090 IP 10.0.1.108.3693 > 239.100.1.1.websm: UDP, length 58 15:41:59.622178 IP 10.0.1.109.35673 > 239.100.1.1.websm: UDP, length 57 ....
tcpdump -i ens33 dst host 10.0.1.251 #监视所有从端口ens33发送到主机10.0.1.251的数据包,主机也可以是主机名 tcpdump -i eth0 host ! 211.161.223.70 and ! 211.161.223.71 and dst port 80 #监听端口eth0,抓取不是来自或去到主机211.161.223.70和211.161.223.71并且目标端口为80的包 tcpdump tcp port 23 host 210.27.48.1 #获取主机210.27.48.1接收或发出的telnet包tcpdump 'tcp port 80 and (((ip[2:2] - ((ip[0]&0xf)<<2)) - ((tcp[12]&0xf0)>>2)) != 0) and src net (183.60.190 or 122.13.220)' -s0 -i eth0 -w ipdump #抓取源或目的端口是80,且源网络是(183.60.190.0/24 或者 122.13.220.0/24),并且含有数据,而不是SYN,FIN以及ACK-only等不含数据的TCP数据包写入文件ipdump #注意这里表达式使用单引号引起来以避免其中的特殊字符被shell解析而造成语法错误 tcpdump 'tcp[tcpflags] & (tcp-syn|tcp-fin) != 0 and ! src and dst net 10.0.0' #只打印TCP的开始和结束包(SYN和FIN标记),并且源和目标网段均不是10.0.0.0/24 tcpdump 'gateway 10.0.1.1 and ip[2:2] > 576' #表示抓取发送至网关10.0.1.1并且大于576字节的IP数据包
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有