I have incoming traffic on eth1
(vlan id 201) which is emitted by another machine which is doing
sudo tcpreplay -x 0.01 --loop=0 --intf1=eth12 Wireshark_bidirectional_data.pcap
I would like to rewrite the destination
to target other devices e.g. 198.19.5.1
... connected on eth1
.
i've enabled
net.ipv4.ip_forward=1
and been trying to forward the data by doing:
table ip nat {
chain postrouting {
type nat hook postrouting priority srcnat; policy accept;
masquerade
}
chain prerouting {
type nat hook prerouting priority dstnat; policy accept;
vlan id 201 ip daddr 198.19.5.1 udp dport { 2000 } dnat to 192.168.2.161:2000
}
}
Hovewer this only works if have a "matching interface" active.
7: eth1.201@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 02:00:00:00:00:13 brd ff:ff:ff:ff:ff:ff
inet 169.254.190.209/16 brd 169.254.255.255 scope global noprefixroute eth1.201
valid_lft forever preferred_lft forever
inet 198.19.5.1/32 scope global eth1.201
valid_lft forever preferred_lft forever
inet6 fe80::742d:66d4:dd72:78dd/64 scope link
valid_lft forever preferred_lft forever
So I would like to achive the same without the "matching interface", I guess I should use a tap device instead.
Please help me configure this without "matching interface"
Also, for starters; just a firm confirmation where someone can confirm that this is possible would be encouraging.