Special case NAT: many to (many of) 1.

Sooo, part of my job is to program a lot hardware that all come with the same default IP. I want to speed it up the process by doing something like this:

Eth1
10.0.0.100 → 192.168.1.5
10.0.0.101 → 10.100.100.1

Eth2
10.0.0.102 → 192.168.1.5
10.0.0.103 → 10.100.100.1

Eth3
10.0.0.104 → 192.168.1.5
10.0.0.105 → 10.100.100.1

and so on, thus allowing me to program many pieces at the same time.

So far I’ve tried:

  • creating a bridge “B1” with an ip of 1.1.1.1
    dst-nat 10.0.0.100 (sometimes netmap) to 192.168.1.20
    mangle 10.0.0.100 and adding a route-mark “toB1”
    add routing path to 10.0.0.100 with pref. source of 1.1.1.1 with route-mark “toB1”

and a ton of variations on that theme. I can get 10.0.0.100 to map to 192.168.1.5 once, but it doesn’t work as soon as I add another 192.168.1.5 device. :frowning:

Any suggestions?

EDIT: Added Eth names