* forward udp broadcast packets on same subnet /interface with diff source
@ 2004-07-14 5:02 Tom Thumb
2004-07-14 5:57 ` George Alexandru Dragoi
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Tom Thumb @ 2004-07-14 5:02 UTC (permalink / raw)
To: netfilter
Hi,
Can I use iptables to forward UDP broadcast packets on
the same subnet and interface but just change the
source IP?
That is, the forwarding machine is 192.168.1.5, with
mask 255.255.255.0 and has a single NIC.
A machine with IP 192.168.1.6 with the same mask sends
a UDP broadcast to 192.168.1.255.
The forwarding machine receives this packet. Can it be
configured to resend it out on the same interface that
it received it on (its only interface) and just change
the source IP to be a 3rd address, like 192.168.1.7,
but also as a UDP broadcast to 192.168.1.255?
Is there any way to do this without adding a physical
NIC? Do I need to add a "virtual" NIC to do it? How?
Thanks
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: forward udp broadcast packets on same subnet /interface with diff source
2004-07-14 5:02 forward udp broadcast packets on same subnet /interface with diff source Tom Thumb
@ 2004-07-14 5:57 ` George Alexandru Dragoi
2004-07-14 9:03 ` Antony Stone
2004-07-14 9:01 ` Antony Stone
[not found] ` <3063e50407132231c03fefc@mail.gmail.com>
2 siblings, 1 reply; 5+ messages in thread
From: George Alexandru Dragoi @ 2004-07-14 5:57 UTC (permalink / raw)
To: Tom Thumb; +Cc: netfilter
One more thingg, you'll have to set ip_forward to 1
On Tue, 13 Jul 2004 22:02:47 -0700 (PDT), Tom Thumb
<tomthumb888@yahoo.com> wrote:
> Hi,
>
> Can I use iptables to forward UDP broadcast packets on
> the same subnet and interface but just change the
> source IP?
>
> That is, the forwarding machine is 192.168.1.5, with
> mask 255.255.255.0 and has a single NIC.
>
> A machine with IP 192.168.1.6 with the same mask sends
> a UDP broadcast to 192.168.1.255.
>
> The forwarding machine receives this packet. Can it be
> configured to resend it out on the same interface that
> it received it on (its only interface) and just change
> the source IP to be a 3rd address, like 192.168.1.7,
> but also as a UDP broadcast to 192.168.1.255?
>
> Is there any way to do this without adding a physical
> NIC? Do I need to add a "virtual" NIC to do it? How?
>
> Thanks
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail Address AutoComplete - You start. We finish.
> http://promotions.yahoo.com/new_mail
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: forward udp broadcast packets on same subnet /interface with diff source
2004-07-14 5:02 forward udp broadcast packets on same subnet /interface with diff source Tom Thumb
2004-07-14 5:57 ` George Alexandru Dragoi
@ 2004-07-14 9:01 ` Antony Stone
[not found] ` <3063e50407132231c03fefc@mail.gmail.com>
2 siblings, 0 replies; 5+ messages in thread
From: Antony Stone @ 2004-07-14 9:01 UTC (permalink / raw)
To: netfilter
On Wednesday 14 July 2004 6:02 am, Tom Thumb wrote:
> Hi,
>
> Can I use iptables to forward UDP broadcast packets on the same subnet and
> interface but just change the source IP?
These broadcast packet questions are starting to get weird now :)
> That is, the forwarding machine is 192.168.1.5, with mask 255.255.255.0 and
> has a single NIC.
>
> A machine with IP 192.168.1.6 with the same mask sends a UDP broadcast to
> 192.168.1.255.
>
> The forwarding machine receives this packet. Can it be configured to resend
> it out on the same interface that it received it on (its only interface) and
> just change the source IP to be a 3rd address, like 192.168.1.7, but also as
> a UDP broadcast to 192.168.1.255?
I don't see how you could, because as you're not changing the destination
address, there's no way to get the pack forwarded through the netfilter
machine, and it needs to get forwarded so that it can reach the POSTROUTING
nat table, where you could do the SNAT and change the source address.
Why, please, do you want to do this???
> Is there any way to do this without adding a physical NIC? Do I need to add
> a "virtual" NIC to do it? How?
My recommendation would be to write a simple program (Perl would do the job if
you don't like C etc) which listens for UDP broadcasts and then generates a
new packet with the destination IP = local subnet broadcast address, and a
faked source IP (192.168.1.7, even though the machine it's running on is
192.168.1.5).
Why do you want to do this?
Antony.
--
If at first you don't succeed, destroy all the evidence that you tried.
Please reply to the list;
please don't CC me.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: forward udp broadcast packets on same subnet /interface with diff source
2004-07-14 5:57 ` George Alexandru Dragoi
@ 2004-07-14 9:03 ` Antony Stone
0 siblings, 0 replies; 5+ messages in thread
From: Antony Stone @ 2004-07-14 9:03 UTC (permalink / raw)
To: netfilter
On Wednesday 14 July 2004 6:57 am, George Alexandru Dragoi wrote:
> One more thingg, you'll have to set ip_forward to 1
Won't help. The packets addressed to 192.168.1.255 have already reached
their destination, therefore the routing table won't forward them further
through the netfilter machine.
Regards,
Antony.
> On Tue, 13 Jul 2004 22:02:47 -0700 (PDT), Tom Thumb
>
> <tomthumb888@yahoo.com> wrote:
> > Hi,
> >
> > Can I use iptables to forward UDP broadcast packets on
> > the same subnet and interface but just change the
> > source IP?
> >
> > That is, the forwarding machine is 192.168.1.5, with
> > mask 255.255.255.0 and has a single NIC.
> >
> > A machine with IP 192.168.1.6 with the same mask sends
> > a UDP broadcast to 192.168.1.255.
> >
> > The forwarding machine receives this packet. Can it be
> > configured to resend it out on the same interface that
> > it received it on (its only interface) and just change
> > the source IP to be a 3rd address, like 192.168.1.7,
> > but also as a UDP broadcast to 192.168.1.255?
> >
> > Is there any way to do this without adding a physical
> > NIC? Do I need to add a "virtual" NIC to do it? How?
> >
> > Thanks
--
Tax inspectors are just accountants who work for the evil dictators of
democracy.
Please reply to the list;
please don't CC me.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: forward udp broadcast packets on same subnet /interface with diff source
[not found] ` <3063e50407132231c03fefc@mail.gmail.com>
@ 2004-07-14 12:18 ` George Alexandru Dragoi
0 siblings, 0 replies; 5+ messages in thread
From: George Alexandru Dragoi @ 2004-07-14 12:18 UTC (permalink / raw)
To: netfilter
Because i am not used with this mailing list, the message that follows
was sent before the ip_forward thingy, but arrived to tom only. And
one thing, you can always change routes for all sort of packets, like
DNAT of packets hich aparently rached theyr destination
---------- Forwarded message ----------
From: George Alexandru Dragoi <waruiinu@gmail.com>
Date: Wed, 14 Jul 2004 07:31:47 +0200
Subject: Re: forward udp broadcast packets on same subnet /interface
with diff source
To: Tom Thumb <tomthumb888@yahoo.com>
Take a loot here:
http://www.netfilter.org/patch-o-matic/pom-extra.html#pom-extra-ROUTE
My ideea (not tested) si to do an
iptables -t mangle -A PREROUTING -p udp -d 192.168.1.255 -s
192.168.1.6 -j ROUTE --gw 192.168.1.5 --continue
iptables -t mangle -A PREROUTING -p udp -d 192.168.1.255 -s
192.168.1.6 -j MARK --set-mark 0x1
then:
iptables -t nat -A POSTROUTING -m mark --mark 0x1 -j SNAT --to 192.168.1.7
On Tue, 13 Jul 2004 22:02:47 -0700 (PDT), Tom Thumb
<tomthumb888@yahoo.com> wrote:
> Hi,
>
> Can I use iptables to forward UDP broadcast packets on
> the same subnet and interface but just change the
> source IP?
>
> That is, the forwarding machine is 192.168.1.5, with
> mask 255.255.255.0 and has a single NIC.
>
> A machine with IP 192.168.1.6 with the same mask sends
> a UDP broadcast to 192.168.1.255.
>
> The forwarding machine receives this packet. Can it be
> configured to resend it out on the same interface that
> it received it on (its only interface) and just change
> the source IP to be a 3rd address, like 192.168.1.7,
> but also as a UDP broadcast to 192.168.1.255?
>
> Is there any way to do this without adding a physical
> NIC? Do I need to add a "virtual" NIC to do it? How?
>
> Thanks
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail Address AutoComplete - You start. We finish.
> http://promotions.yahoo.com/new_mail
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-07-14 12:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-14 5:02 forward udp broadcast packets on same subnet /interface with diff source Tom Thumb
2004-07-14 5:57 ` George Alexandru Dragoi
2004-07-14 9:03 ` Antony Stone
2004-07-14 9:01 ` Antony Stone
[not found] ` <3063e50407132231c03fefc@mail.gmail.com>
2004-07-14 12:18 ` George Alexandru Dragoi
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.