Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Moritz Gartenmeister <moritz.gartenmeister@access.unizh.ch>
To: netfilter@lists.netfilter.org
Subject: iptables dnat, ebtables, mark
Date: Wed, 10 Nov 2004 16:41:05 +0100	[thread overview]
Message-ID: <41923691.40803@access.unizh.ch> (raw)

hi

my idea:
i know the mac-adress from a compromised computer in my lan. i want to redirect all the traffic from 
this computer to a webserver (to show up a page with e.g. "bad guy! you got a virus").

my system:
debian testing 2.6.7
iptables
ebtables
bridge-code

my solution so far:
ebtables -t nat -A PREROUTING -s $MAC -j mark --set-mark 8 --mark-target CONTINUE
there are no other rules in this chain.
some more rules in -A FORWARD all with -s macadress, but not the one above.

is the only rule in prerouting nat.
iptables -t nat -A PREROUTING -m mark --mark 0x8 -j DNAT --to-destination $IP-WWW

is the first role in the mangle chain.
iptables -t mangle -A PREROUTING -m mark --mark 0x8 -j ACCEPT

one check rule in mangl POSTROUTING
iptables -t mangle -A POSTROUTING -m -mark --makr 0x8 -j LOG --log-prefix IPT_MARK

my problem:
the user can access the webserver and only this server, but the user is not redirected to the 
web-server, if he tries to access e.g. www.google.com. he only get an error-message.

my observation:
number of packets differ...
ebtables 213 packets
prerouting mangle 200 packets
prerouting nat 118 packets
postrouting mangle 93 packets

any explanations? the number should be at least the same. i don't understand this. the filter-rules 
seem to work properly...

cheers
moritz


             reply	other threads:[~2004-11-10 15:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-10 15:41 Moritz Gartenmeister [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-11-10 15:42 iptables dnat, ebtables, mark Moritz Gartenmeister
2004-11-10 15:56 ` Jason Opperisano
2004-11-10 16:16   ` Moritz Gartenmeister
2004-11-10 16:22 ` Josh Nerius
2004-11-15 14:36   ` Moritz Gartenmeister

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41923691.40803@access.unizh.ch \
    --to=moritz.gartenmeister@access.unizh.ch \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox