一台Linux这两天不停往外发包,造成外部无法访问。
[root@ct-nat ~]# watch ifconfig-------------查看数据包新增情况
Every 2.0s: ifconfig Thu Jun 5 14:24:14 2014
eth0 Link encap:Ethernet HWaddr 00:18:FE:FA:C3:42
inet addr:124.14.10.68 Bcast:124.14.10.71 Mask:255.255.255.248
inet6 addr: fe80::218:feff:fefa:c342/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1665533 errors:0 dropped:0 overruns:0 frame:0
TX packets:73298941 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1547042409 (1.4 GiB) TX bytes:803948852 (766.7 MiB)
Interrupt:169 Memory:dc200000-dc210000
eth1 Link encap:Ethernet HWaddr 00:18:FE:FA:C3:43
inet addr:118.26.96.1 Bcast:118.26.96.255 Mask:255.255.255.0
inet6 addr: fe80::218:feff:fefa:c343/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1568748 errors:0 dropped:0 overruns:0 frame:0
TX packets:1634074 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1067734779 (1018.2 MiB) TX bytes:1544805241 (1.4 GiB)
Interrupt:82 Memory:dc300000-dc310000
[root@ct-nat ~]# ifstat----查看网卡流量
eth0 eth1
KB/s in KB/s out KB/s in KB/s out
407.34 154.99 134.96 324.29
274.08 191.48 210.72 248.32
240.20 192.91 257.22 179.06
136.48 236.72 203.89 179.84
243.03 198.90 221.65 241.85
198.83 281.42 271.65 195.79
820.90 247.96 254.28 791.47
109.24 226.05 208.80 94.16
311.23 190.03 190.82 523.41
394.65 216.71 215.69 284.40
651.62 232.83 196.13 599.50
147.94 162.41 199.19 102.64
119.03 222.98 210.04 135.29
214.74 132.68 80.85 227.86
286.41 75.55 88.74 386.44
321.54 91.63 120.95 228.31
146.83 221.96 407.25 124.37
[root@ct-nat ~]# nload-------以流量图显示
Device eth0 [124.14.10.68] (1/4):
==================================================================================================
Incoming:
||
##
##
##
##
##|| ##
#### | ## ..
#### # ## ##
## |##### ## # ## .. ## Curr: 439.54 kBit/s
## .. ###### ## #. ##.. ## ####|| ## Avg: 1.88 MBit/s
## ..## ## ######|| ##### #### ##.. ###### ## Min: 0.00 Bit/s
## #### ||## ######## #####..#### ..#### ######||..||## Max: 8.05 MBit/s
########## ######.. #########################||######||||##############... Ttl: 1.65 GByte
Outgoing:
........||
.. ############
## ..############
## ################
||##..################ Curr: 1.00 MBit/s
| ###################### Avg: 2.16 MBit/s
.. ........ .... # ######################.. || Min: 0.00 Bit/s
....##||########||## ################| ########################||##..####. Max: 5.48 MBit/s
############################################################################ Ttl: 898.95 MByte
[root@ct-nat ~]# iptraf ------------很直观的工具
IPTraf
+---------------------------------+
| IP traffic monitor |
| General interface statistics |
| Detailed interface statistics |
| Statistical breakdowns... |
| LAN station monitor |
|---------------------------------|
| Filters... |
|---------------------------------|
| Configure... |
|---------------------------------|
| Exit |
+-----------------------------
可以用 sar -n DEV 1 4 查看发包数量:
[root@ct-nat ~]# sar -n DEV 1 4
Linux 2.6.18-164.el5PAE (ct-nat) 06/05/2014
02:20:38 PM IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s
02:20:39 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
02:20:39 PM eth0 855.10 290.82 832319.39 140028.57 0.00 0.00 0.00
02:20:39 PM eth1 244.90 856.12 100502.04 884775.51 0.00 0.00 0.00
02:20:39 PM sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
02:20:39 PM IFACE rxpck/s txpck/s rxbyt/s txbyt/s rxcmp/s txcmp/s rxmcst/s
02:20:40 PM lo 0.00 0.00 0.00 0.00 0.00 0.00 0.00
02:20:40 PM eth0 1010.20 251.02 1059435.71 79747.96 0.00 0.00 0.00
02:20:40 PM eth1 287.76 1108.16 76557.14 1143078.57 0.00 0.00 0.00
02:20:40 PM sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00
用这个查看发包的端口:netstat -tu -c
[root@ct-nat ~]# netstat -tu -c
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 124.1.1.68:49995 218.66.170.184:10991 ESTABLISHED
tcp 0 0 ::ffff:118.26.96.1:ssh ::ffff:118.26.96.248:41077 ESTABLISHED
tcp 0 0 ::ffff:118.26.96.1:ssh ::ffff:118.26.96.248:42562 ESTABLISHED
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 124.1.1.68:49995 218.66.170.184:10991 ESTABLISHED
tcp 0 0 ::ffff:118.26.96.1:ssh ::ffff:118.26.96.248:41077 ESTABLISHED
tcp 0 0 ::ffff:118.26.96.1:ssh ::ffff:118.26.96.248:42562 ESTABLISHED
用 lsof -i :39733 查看端口的进程,Kill就可以了
- 几种在Linux下查询外网IP的办法。
几种在Linux下查询外网IP的办法. Curl 纯文本格式输出: curl icanhazip.com curl ifconfig.me curl curlmyip.com curl ip.ap ...
- 闲置安卓设备搭建Linux服务器实现外网访问
title: 闲置安卓设备搭建Linux服务器实现外网访问 这是我搭过的第一个博客系统,写贴纪念一下 待博主整理好思路,将今天所用到的全部分享! 好吧,我就是穷.富人靠科技,穷人靠变异.我这种穷人是真 ...
- Linux服务器大量向外发包问题排查
最近Linux redhat 6.5 APP 业务系统,向外大量发送流量,不断建立tcp连接,目标地址是美国的一个IP,估计被当成肉鸡了,比较悲惨,直接飞向IDC机房,防火墙显示这个APP服务器tcp ...
- linux下的外网木马前期要的工具
这周看了demon哥的博客弄msf外网马,自己试了一下 首先去ngrok官网下载对应的系统版本,如果对应下载那个标签是绿色的(这里不支持windows) 下载好后在linux提取出来 让我们来看看他的 ...
- vm虚拟机中linux无法连接外网?
问题出现的环境? vm虚拟机中安装了linux系统,vm设置了NAT方式共享主机ip,但还是没法访问外网?在linux系统中查询ip地址,没有ipv4地址,就是配置了自动获取,但是还是没有获取? 问题 ...
- Linux配置Redis外网访问
下载:redis-3.2.5.tar.gz 拷贝到指定目录解压:tar -xzvf redis-3.2.5.tar.gz 进入到解压目录redis-3.2.5下安装: makemake install ...
- Linux ping不通外网
在linux中ping www.baidu.com 无法ping通,可能原因是DNS没配置好 方法一: 修改vi /etc/resolv.conf 增加如下内容: nameserver 114.11 ...
- linux内核构造skb发包-----raw、tcp网络编程
1. 内核raw发包 #include <linux/init.h>#include <linux/module.h> #include <linux/kernel.h& ...
- 重新整理 .net core 实践篇 ———— linux 上线篇 [外篇]
前言 简单整理一个linux 简单上线. 这个是该系列的外篇,该系列继续更新.献给刚学的人. 正文 安装实例 dotnet new webapp -n AspNetCoreDemo -o firstw ...
随机推荐
- [Errno 14] PYCURL ERROR 7 - "couldn't connect to host"
该问题就是防火墙的问题.关闭即可. /etc/init.d/iptables stop
- polynomial time
https://en.wikipedia.org/wiki/Time_complexity#Polynomial_time An algorithm is said to be of polynomi ...
- 经典的css reset代码 (reset.css)
<style> html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, ...
- 我的Java开发学习之旅------>Base64的编码思想以及Java实现
Base64是一种用64个字符来表示任意二进制数据的方法. 用记事本打开exe.jpg.pdf这些文件时,我们都会看到一大堆乱码,因为二进制文件包含很多无法显示和打印的字符,所以,如果要让记事本这样的 ...
- vim下的ctags和taglist等的使用和配置
1.ctags (1)到 http://prdownloads.sourceforge.net/ctags/ctags-5.6.tar.gz 下载ctags源码ctags-5.6.ta ...
- || and && 理解
逻辑或(||): 只要第一个值的布尔值为false,那么永远返回第二个值. 逻辑或属于短路操作,第一个值为true时,不再操作第二个值,且返回第一个值. 逻辑与(&&): 只要第一个值 ...
- [原创]Scala学习:Tuple,Array,Map ,文件操作
1.Tuple:元祖.是一个有用的容器对象. 1)特点: ① 元祖是不可变的,即,当声明完了一个元祖,那么它的长度就不可以在改变: ② 元祖可以包含不同类型的数据,对象: ③ 索引是从 '_1 ...
- Python问题解决记录
Python如何进行中文注释:网址 解决Python UnicodeEncodeError: 'ascii' codec can't encode: 网址1.网址2.网址3 Python 字符串转换为 ...
- 修改push动画的方向
CATransition *animation = [CATransition animation]; animation.duration = 0.4; animation.timingFuncti ...
- 算法(Algorithms)第4版 练习 1.5.4
代码实现: package com.qiusongde; import edu.princeton.cs.algs4.StdIn; import edu.princeton.cs.algs4.StdO ...