All of lore.kernel.org
 help / color / mirror / Atom feed
* iptables dnat, ebtables, mark
@ 2004-11-10 15:42 Moritz Gartenmeister
  2004-11-10 15:56 ` Jason Opperisano
  2004-11-10 16:22 ` Josh Nerius
  0 siblings, 2 replies; 6+ messages in thread
From: Moritz Gartenmeister @ 2004-11-10 15:42 UTC (permalink / raw)
  To: netfilter

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


-- 
Uplink student association
Moritz Gartenmeister
Bülachstrasse 1 F
8057 Zürich
Switzerland


^ permalink raw reply	[flat|nested] 6+ messages in thread
* iptables dnat, ebtables, mark
@ 2004-11-10 15:41 Moritz Gartenmeister
  0 siblings, 0 replies; 6+ messages in thread
From: Moritz Gartenmeister @ 2004-11-10 15:41 UTC (permalink / raw)
  To: netfilter

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-11-15 14:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
2004-11-10 15:41 Moritz Gartenmeister

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.