Netfilter rules to replicate, consume ingress packet locally and forward clone packet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I am looking for netfilter rules to accomplish the following requirements.
1. every UDP packet received on the interface i.e. eht0 should be
consumed locally.
 2. replicate same packet and Forward to other interface i.e. enp7s0

experiment done.
1 .Host PC IP 192.168.1.3 which is connected to DUT eth0.
2. DUT  eth0 - 192.168.1.4
         enp7s0  10.40.197.108
3. Another Host which is in 10.40... network having IP 10.40.198.9
connected to     enp7s0 of DUT.

Rules :
sudo iptables -t mangle -A PREROUTING -d 192.168.1.4  -j TEE --gateway
10.40.198.9
sudo iptables -t nat -A OUTPUT -s 192.168.1.3 -j DNAT --to-destination
10.40.198.9
sudo iptables -t mangle -A INPUT -s 192.168.1.3  -j ACCEPT

Issue Seen with this rule:
1. packets from #1 Host PC get cloned until TTL becomes 1/0. So there
are multiple replications.

please help here to understand the correct rules for the requirement.

Regards,
Rakesh



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux