ntzyz's space

∠( ᐛ 」∠)_

Category

  • Algorithm
  • Figures
  • Gameplay
  • Linux
  • Network
  • Other
  • Photos
  • Web

Tags

  • Linux
  • PS4
  • JavaScript
  • A6300
  • A7M3
  • OpenWrt
  • HTML5
  • FE55
  • node
  • VPN
  • Web
  • Arcaea
  • Tunnel
  • 猫
  • 手办
  • Network
  • iptables
  • 狗
  • systemd
  • AudioContext
  • PowerShell
  • 雪
  • CSharp
  • SQLite
  • NVMe
  • UglifyJS
  • PPTP
  • PHP
  • Surface
  • LeetCode
  • Routing
  • Highlight.js
  • CI
  • FE24105G
  • MediaSource
  • FromSoftware
  • MHW
  • Algorithm
  • WireGuard
  • SVP
  • IPv6
  • SDL
  • Highcharts.js
  • USB
  • Gaming
  • CAPCOM
  • GitHub
  • iSCSI
  • HDOJ
  • MPV
  • UEFI
  • HTML
  • Arch Linux
  • NAT
  • MySQL
  • Sekiro
  • WebAssembly
  • Node
  • Minecraft

Recent replies

  • spinmry 发表于「CoreMark WebAssembly」
  • spinmry 发表于「CoreMark WebAssembly」
  • ntzyz 发表于「CoreMark WebAssembly」
  • Hatsuroku 发表于「CoreMark WebAssembly」
  • Kyle 发表于「用 Elastic Stack 拯救 Telegram 的中文搜索」
  • ShellBin 发表于「Cinebench」
  • ntzyz 发表于「Windows 10 网络连接共享重启失效的临时解决方案」
  • Hughton 发表于「Windows 10 网络连接共享重启失效的临时解决方案」
  • Gaein nidb 发表于「使用 UEFI Shell 加载 NVMe 驱动」
  • ShellBin 发表于「DSC01764」

Links

About me
WordPress 存档
Cinebench 跑分记录
Coremark WebAssembly 跑分记录
Hpoi 手办维基 个人页
ZephRay
>Lithia's Core
业余无线电台 BD4SUR
Ferrets 家的 Wordpress
spinmry实验室
Yuno's Wonderland
notonokodds
春上冰月的博客
kasora's blog
徐靖峰 | 个人博客
蒋炜成 | 个人博客
Test2g
447f.Misaka
Project RC
Shell Bin
标签:iptables

土制服务器流量统计

2019 年 6 月 5 日分类:Linux#iptables#systemd#MySQL

假设某服务器有一个接口 eth0,并配置了三个 IP 地址 10.0.0.4, 10.0.0.5, 10.0.0.6。需求就是,如何知道这一台服务器每个 IP 的历史出网流量。

思路由 @a350063 提供,很简单,活用 iptables 的计数器就 OK 了。这种方法非常灵活,可以对任何能用 iptables 规则描述的流量数据进行统计,比如统计某个源地址指定端口的进出流量。首先我们使用 iptables 增加一些规则:

# iptables -I OUTPUT -s 10.0.0.4/32 -j ACCEPT
# iptables -I OUTPUT -s 10.0.0.5/32 -j ACCEPT
# iptables -I OUTPUT -s 10.0.0.6/32 -j ACCEPT

执行完成之后,就可以直接使用命令 iptables -nvxL OUTPUT 看到每个 IP 的出网流量了:

# iptables -nvxL OUTPUT
Chain OUTPUT (policy ACCEPT 3856 packets, 1914416 bytes)
    pkts      bytes target     prot opt in     out     source               destination         
   12880   11794276 ACCEPT     all  --  *      *       10.0.0.4             0.0.0.0/0           
    6850    5801012 ACCEPT     all  --  *      *       10.0.0.5             0.0.0.0/0           
     110       9315 ACCEPT     all  --  *      *       10.0.0.6             0.0.0.0/0
MORE

[Node.js] 学校网关登陆脚本

2017 年 9 月 22 日分类:Network#node#JavaScript#VPN#NAT#iptables
提示:在继续阅读之前,请注意此文章最后更新于 1300 天前,其中的部分内容可能已经无效或过时。

虽然现在我在的学校很辣鸡,但是偶然间发现所有的教学区设备,在通过网关认证后,就可以获得一个江苏省常州市教育网的公网 IP 地址,同时拥有 10Mbps 的上下对等带宽,还是蛮良心的(

然后我们就在某办公室内放置了一个配置极其破烂的台式机,用来转发内网端口,VPN 远程接入和其他奇奇怪怪的服务。然而所有这些的前提就是通过了网关认证。比较尴尬的是那台电脑并没有显示器,所以我们只能想其他办法实现这一步骤。

MORE
  • «
  • 1
  • »
Copyright © 2016-2019 ntzyz. All rights reserved.
Except where otherwise noted, content on this blog is licensed under CC-BY 2.0.