Score:0

UDP Port Forwarding

ao flag
xtg

I got 2 servers Named A and B, both are in different data centers and just have internet access. I need the incoming UDP connections to a particular port on server A to be forwarded to a specific port on server B. ssh tunneling is just for TCP. I could not get udp2raw working. any idea? thanks in advance.

Score:1
lk flag
iptables -t nat -A PREROUTING -p UDP -i eth0 -d 192.0.2.1 --dport 9999 -j DNAT --to-destination 192.0.2.2:8888

eventually add this if your FROWARD policy is not ACCEPTing all

iptables -A FORWARD -p UDP -d 192.0.2.1 --dport 9999 -j ACCEPT
xtg avatar
ao flag
xtg
I got confused a bit, Imagine I'm going to forward incoming UDP connections on port 10 in Host B with address B.B.B.B to UDP port 20 on host A with address A.A.A.A Can you edit the command with these parameters? then I can replace parameters
xtg avatar
ao flag
xtg
Don't I need a process to listen the specific port on forwarding host?
exeral avatar
lk flag
your statement "forward incoming UDP connections on port 10 in Host B with address B.B.B.B to UDP port 20 on host A" is the opposite of your original question: "incoming UDP connections to a particular port on server A to be forwarded to a specific port on server B" that's not clear. No, you don't need a listening process. iptables (linux kernel) intercept the packet before
xtg avatar
ao flag
xtg
I just replaced A with B, imagine the second statement, now how parameters should be replaced?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.