Score:0

Syntax Iptables and routing UDP protocol

lt flag

I have a debian routeur server with two interfaces, one on the net, and one on the DMZ.

I want to route the UDP protocol to internet to DMZ.

What about this rules?

iptables -t mangle -A INPUT -i [InternetInterfaces] -p udp 10000 -d 0.0.0.255 -j TEE --gateway IPOFDMZINTERFACE

Thanks a lot for helping me.

Regards

jabbson avatar
sb flag
`...route ...to internet to DMZ` so where do you want to route it? If you want to change the routing, why don't you do it through the means of routing (ie changing routes)?
ArnOCP avatar
lt flag
Sorry for my poor english, i want to route **from** internet to DMZ
Score:0
in flag

It looks like you rather need to NAT traffic from the Internet to DMZ. If that's the case, your iptables rule should look like this:

iptables -t nat -A PREROUTING -p udp -m udp --dport 10000 -j DNAT --to <ip.of.dmz.host>

Also, make sure IP forwarding is enabled with

sysctl net.ipv4.ip_forward=1
ArnOCP avatar
lt flag
thanks a lot for replying, but i have allready done this nat rule without success:`root@SERVER:~# iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT udp -- anywhere anywhere udp spt:10000 Chain FORWARD (policy ACCEPT) target prot opt source destination ACCEPT udp -- anywhere 10.67.X.X udp dpt:10000 Chain OUTPUT (policy ACCEPT) target prot opt source destination`
user999441 avatar
in flag
These rules are wrong and redundant (chain policy is ACCEPT anyway). Note the 'nat' table and 'PREROUTING' / 'POSTROUTING' chain in my answer.
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.