Score:0

iptables redirect udp traffic from one interface to another, or from one host to another on the same interface

jp flag
iptables -t nat -A PREROUTING -p udp -m udp --dport 1197 -j DNAT --to-destination 1.2.3.4:8081

On eth0 I am receiving udp packes destined for port 1197. I want to emit those packets on another interface and change the destination ip and port. This doesn't seem to be working according to wireshark. I have ip forwarding enabled

My longer term goal is to split two udp streams that are arriving on the same port from two different ips, so that one stream goes to a different port, and I am having trouble simulating that in my current network (sending udp data to my laptop from a different host, i.e. not use the loopback because that requires a different set of rules)

Alternatively, I am trying to use iptables -t nat -A PREROUTING -p udp -s $SRC_IP --dport $DPORT -j DNAT --to-destination $NEW_IP:$NEW_PORT where SRC_IP and NEW_IP are on the same interface. I basically want to reflect this traffic to a new host on the same network

-t mangle -j TEE also doesn't seem to be doing anything

us flag
Please describe your network topology, how exactly are different hosts connected.
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.