Skip to contentSkip to conversation

port translation on the same network

DISCUSSION gene bene 3 participants 3 messages Jul 18, 2004 – Jul 19, 2004

lore
Share & tools
lore

gene bene

author
#0 lore raw

I have a print job in my network which comes in on port 10001 raw packets (from a citrix server)

I need to use iptables to translate the port number to 9100

I have tried to set up a virtual ip (eth0:0) and use DNAT and SNAT to translate the port with no success.

Can anyone help me with the correct settings?

Gene

#1 lore raw

iptables -t nat -A PREROUTING -i eth0 -d <my ip> -p tcp --dport 10001 -j SNAT --to <my ip>:9100

Quoted 13 lines · gene bene

I have a print job in my network which comes in on port 10001 raw packets (from a citrix server)

I need to use iptables to translate the port number to 9100

I have tried to set up a virtual ip (eth0:0) and use DNAT and SNAT to translate the port with no success.

Can anyone help me with the correct settings?

Gene

#2 lore raw
In reply to gene bene
Quoted 9 lines · gene bene

I have a print job in my network which comes in on port 10001 raw packets (from a citrix server)

I need to use iptables to translate the port number to 9100

I have tried to set up a virtual ip (eth0:0) and use DNAT and SNAT to translate the port with no success.

Can anyone help me with the correct settings?

Apply this rule on the machine receiving the packets:

iptables -A PREROUTING -t nat -p tcp --dport 10001 -j DNAT --to :9100

(Assuming you meant they are TCP packets; if they're UDP just change the rule in the obvious manner).

Regards,

Antony.

Signature · 4 lines
This email was created using 100% recycled electrons.

                                                     Please reply to the list;
                                                           please don't CC me.