Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Christian Riechmann <riechmann@fgan.de>
To: netfilter@lists.netfilter.org, netfilter-devel@lists.netfilter.org
Cc: mail@criechmann.de
Subject: Need some clarification or help
Date: Tue, 20 Apr 2004 20:22:05 +0200	[thread overview]
Message-ID: <20040420182205.GA2948@rie.rie.priv> (raw)

Hello,

is it possible to read - via ipq_read/ipq_get_packet - a UDP packetr
and after some changes to accept - via ipq_set_verdict with NF_ACCEPT and
shorter length - it as a TCP packet?

Here is what I wish to do:
For the transmission of IP packets (UDP, ICMP, TCP) between two hosts
I want to send these packets through a UDP tunnel.
On the sender I am using iptables to get all the original packets into user
space for their encapsulation and UDP sending.
In the same way on the receiver I use iptables to get those UDP packets
from the sender enclosing the original packets into user space, where
I decapsulate the original packets and wish to inject these by using
ipq_set_verdict with action set to NF_ACCEPT.
This method works for original packets of type ICMP and UDP, but NOT
for TCP packets.
What I can see from my tcpdump logging on the receiver is:
1.That all three types of original packets are ACCEPTED, but tcpdump
  shows some additional bytes (packet length is still the same as given by
  m->data_len upon the ipq_get_packet call, although the ipq_set_verdict
  call get an updated length).
2.Those original packets of type UDP and ICMP can be read by the intended
  receiver programs but those of type TCP are not presented to the
  intended receiver application.

Below I attach those iptables rules I am using.

# Parameter setting:
#  $1:	Iptable operation "A"
#  $2:  Interface name
#  $3:  IP address of this host
#
# Next rule:
#    Send out all BROADCAST packets
#
#iptables -$1 OUTPUT -o $2 -d 128.7.27.255 --destination-port 140 -j ACCEPT
iptables -$1 OUTPUT -o $2 -d 128.7.27.255 -j ACCEPT

#
# Next rule:
#    Show me all locally generated multicast packets before routing
#
iptables -$1 OUTPUT -o $2 -d 224.0.0.0/4 -j QUEUE

#
# Next rule:
#    Show me all locally generated packets before routing
#
iptables -$1 OUTPUT -o $2 -j QUEUE

#
# Next rule:
#    Show me all UDP packets for port 140 arriving from foreign hosts
#
iptables -$1 INPUT -i $2 -p udp --destination-port 140 -j QUEUE

#
# Next rule:
#    DROP all multicast packet sent by any host except the local one
#
iptables -$1 INPUT -i $2 -s ! $3 -d 224.0.0.0/4 -j DROP


Thanks for any help or clarification.

Christian
-- 
Christian Riechmann    E-Mail: riechmann@fgan.de
c/o FGAN/FKIE          Tel: (+49) 228/9435 345,378
Neuenahrer Strasse 20  Fax: (+49) 228/9435 685
D-53343 Wachtberg, Germany


             reply	other threads:[~2004-04-20 18:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-20 18:22 Christian Riechmann [this message]
2004-04-20 18:47 ` Need some clarification or help Antony Stone
2004-04-20 20:51   ` Christian Riechmann
2004-04-20 21:07     ` Antony Stone
2004-04-21 11:45       ` Christian Riechmann
2004-04-20 21:32     ` Jee J.Z.
2004-04-21 11:14       ` Christian Riechmann
2004-04-21 15:41         ` Jee J.Z.
2004-04-21 19:51           ` Christian Riechmann
2004-04-21 22:17             ` Jee J.Z.
2004-04-22 20:41               ` root
2004-04-22 21:34                 ` Jee J.Z.
2004-04-23 10:17                   ` Christian Riechmann
2004-04-22  0:38 ` Henrik Nordstrom
2004-04-22 21:32   ` Christian Riechmann
2004-04-23  7:02     ` Henrik Nordstrom
2004-04-23 10:22       ` Christian Riechmann

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=20040420182205.GA2948@rie.rie.priv \
    --to=riechmann@fgan.de \
    --cc=mail@criechmann.de \
    --cc=netfilter-devel@lists.netfilter.org \
    --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