Score:0

Iptables and route2 to achieve multiple WAN IPs

ee flag

Debian based machine with 1 wireless NIC. That would be wlan0, tap1 and tap2 (both tap installed with tuntap). tap1 and tap2 have their own MAC addresses and public IPs set.

I have removed all the rules and table configs by:

ip rule flush (removes all rules except localhost ones)
ip route flush table all

I need your help to tell me how to mark the incoming connections with iptables and thus redirect the packet to the corresponding policy table by comparing the dst (on the packet). For example 23.23.44.11(or any other) tries to connect my machine to IP 11.11.11.10. This IP address is usually assigned to tap1 and this interface has its own policy table called tap1table.

Another example 23.23.44.11(or any other) tries to connect my machine to IP 11.11.11.12. This IP address is assigned to tap2 and as well this interface has own policy table tap2table. It has to be done with fwmark I guess but don't know how.

Any help how to do this ?

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.