Networking Forums

Networking Forums > Computer Networking > Linux Networking > change source ip of udp streams

Reply
Thread Tools Display Modes

change source ip of udp streams

 
 
bubzilla
Guest
Posts: n/a

 
      10-18-2006, 10:36 AM
hi,

i´m using

iptables -t nat -A POSTROUTING -p udp --dport 1001 -j SNAT --to
192.168.100.5:25001

to change the source ip to 192.168.100.5 for every outgoing udp packet
with 1001 as destination port.

Now if i want to use two rules like:
iptables -t nat -A POSTROUTING -p udp --dport 1001 -j SNAT --to
192.168.100.5:25001
iptables -t nat -A POSTROUTING -p udp --dport 1002 -j SNAT --to
192.168.100.5:25002

the secound doesn´t work anymore!
but why?

 
Reply With Quote
 
 
 
 
bubzilla
Guest
Posts: n/a

 
      10-18-2006, 11:04 AM
to make the problem more clearly, i´ve got two sockets open one on
25001 the other on 25002.
Now if see that the two iptable-rules do work. but first i have to
write all the data from 25001 and then after all are written from
25002.

The Data from 25002 is only 1% as much as from 25001.

Can someone explane why iptables doesnßt allow direkt written of the
socket?!?

 
Reply With Quote
 
Jeroen Geilman
Guest
Posts: n/a

 
      10-18-2006, 08:33 PM
bubzilla wrote:
> hi,
>
> i´m using
>
> iptables -t nat -A POSTROUTING -p udp --dport 1001 -j SNAT --to
> 192.168.100.5:25001
>
> to change the source ip to 192.168.100.5 for every outgoing udp packet
> with 1001 as destination port.
>
> Now if i want to use two rules like:
> iptables -t nat -A POSTROUTING -p udp --dport 1001 -j SNAT --to
> 192.168.100.5:25001
> iptables -t nat -A POSTROUTING -p udp --dport 1002 -j SNAT --to
> 192.168.100.5:25002
>
> the secound doesn´t work anymore!
> but why?


Because SNAT is a target ?
I.e. the packet does not return from a "-j SNAT" to follow the rest of
the POSTROUTING chain - the second rule is never executed.

And even if it were executed - how would you magically turn one packet
into TWO ?

Look at the "tee" option; you need a special iptables module to be able
to use it, i.e. it's not in a stock kernel build, but it can "split" a
packet in two.

Your second post was unfortunately completely unintelligible.

J.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multicast streams launched? DAB sounds worse than FM Broadband 20 10-10-2007 04:51 PM
Substitute for Streams Environment Baboon Windows Networking 8 09-17-2007 06:30 AM
why linux don't use streams ?? Lalatendu Das Linux Networking 2 06-30-2006 02:27 PM
Change default source IP of outgoing packets in multihomed config? Andy Shepard Linux Networking 0 06-16-2005 07:09 PM
how tho change source address of eth0/eth0:1 ? news Linux Networking 2 06-09-2004 03:25 PM



1 2 3 4 5 6 7 8 9 10 11