Generic map, also with L4 protocol
Marc SCHAEFER <[email protected]>
| Newsgroups | gmane.comp.security.firewalls.netfilter.general |
|---|---|
| Message-ID | <[email protected]> |
Hello,
for dynamic DNAT, I use:
map multihoming_ext {
type ipv4_addr . inet_service : ipv4_addr . inet_service
elements = {
46.140.72.218 . 8080 : 192.168.202.10 . 80,
193.72.186.130 . 8080 : 192.168.202.10 . 80
}
}
chain multihoming_prerouting {
type nat hook prerouting priority -100; policy accept;
dnat ip addr . port to ip daddr . tcp dport map @multihoming_ext
}
This seems to DNAT correctly as wanted:
46.140.72.218:8080 is DNATted to 192.168.202.10:80
and
193.72.186.130:8080 is DATted to 192.168.202.10:80
To make it even more generic and dynamic, I would like to have also the
protocol in the map, something like:
map multihoming_ext {
type ipv4_addr . inet_proto . inet_service : ipv4_addr . inet_service
elements = {
46.140.72.218 . tcp . 8080 : 192.168.202.10 . 80,
193.72.186.130 . tcp . 8080 : 192.168.202.10 . 80
}
}
However I have no idea how to modify the DNAT line itself to
get the L4 protocol from the map correctly.
Do you have any idea?
Thank you.