🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: de.comp.os.unix.linux.misc
Article #197

Re: Internet log-Datei?

#197
From: Erwin Burgstaller
Date: Sun, 06 Jan 2002 23:01
57 lines
2728 bytes
Tino Svatek <tino.svatek@tirol.com> wrote:
> Hi Leute,
> 
> Ich betreibe ein SuSE Linux 7.3 mit Kernel 2.4.10 al Internetgateway f�r mein
> Netzwerk.
> Nun m�chte ich gerne alle Internetverbindungen (und nur die
> Internetverbindungen) mitloggen, damit ich diese mit einem Perl-Script
> auswerten kann. Wie gehe ich dieses an? Ich verwende keine Proxy, da keine
> Offline Daten zur Verf�gung stehen sollen. Man kann sich das Ganze wie ein
> Internetcafe vorstellen, das ich zentral abrechnen will.
> Wer hat Ideen dazu?

Ich w�rde es mit iptables oder ipchains machen.

z.B. so (ist von einem Router WAN<->Router<->LAN)

#!/bin/sh
set -x

# Foo ins Internet
ipchains -F foo 2>/dev/null
ipchains -X foo 2>/dev/null

ipchains -N foo

# Foo ins LAN
ipchains -F foolo 2>/dev/null
ipchains -X foolo 2>/dev/null

ipchains -N foolo

# Netbios Zeugs schmeissen wir weg
$IPCHAINS -A input -p tcp -s 10.40.0.0/16 137:139 -j REJECT -l
$IPCHAINS -A input -p udp -s 10.40.0.0/16 137:139 -j REJECT -l

# ist das Paket vom oder fuers Internet dann springen wir in den foo chain
ipchains -I input -s 10.40.0.0/16 -d ! 10.17.0.0/16   -j foo
ipchains -I input -s 10.40.0.0/16 -d ! 192.168.2.0/24 -j foo
ipchains -I input -d 10.40.0.0/16 -s ! 10.17.0.0/16   -j foo
ipchains -I input -d 10.40.0.0/16 -s ! 192.168.2.0/24 -j foo

# ist fuer lokales Netz, wir springen in den foolo chain
ipchains -I input -s 10.40.0.0/16 -j foolo
ipchains -I input -d 10.40.0.0/16 -j foolo

ipchains -A foo -j ACCEPT
ipchains -A foolo -j ACCEPT


In der Auswertung kann man dann mit:

ipchains -v -n -x -L foo

die Mengen auslesen. Mit iptables geht's so �hnlich.


Erwin
Technical Details
Message-ID: <3c38d745$1@ictas.tu-graz.ac.at>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!ictas.tu-graz.ac.at!62.46.181.21
References: <9926d9c4c2f0fb8832408f102d0ce7ce.12747@mygate.mailgate.org>

Show Full Headers
Complete Article Headers
X-Google-Language: GERMAN,ASCII
X-Google-Thread: 1101c9,508036e241967d23
X-Google-Attributes: gid1101c9,public
X-Google-Thread: f55df,508036e241967d23
X-Google-Attributes: gidf55df,public
X-Google-ArrivalTime: 2002-01-06 15:01:26 PST
Newsgroups: de.comp.os.unix.linux.misc,at.linux
From: Erwin Burgstaller <ber@fastrun.at>
Subject: Re: Internet log-Datei?
References: <9926d9c4c2f0fb8832408f102d0ce7ce.12747@mygate.mailgate.org>
Followup-To: at.linux
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: 8bit
User-Agent: slrn/0.9.7.3 (Linux)
NNTP-Posting-Host: 62.46.181.21
Message-ID: <3c38d745$1@ictas.tu-graz.ac.at>
Date: 7 Jan 2002 00:01:25 +0100
X-Trace: 7 Jan 2002 00:01:25 +0100, 62.46.181.21
Lines: 58
X-Complaints-To: abuse@ictas.tu-graz.ac.at
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!ictas.tu-graz.ac.at!62.46.181.21