# 2 LANs + binat



## alfi (Oct 10, 2016)

Hello, i have a problem here. I got 2 same networks 10.20.0.0/16, this networks have 2 servers as routers on freebsd+pf. This routers connected to each other through a wire through separate interfaces a_if and b_if, there is a lan between them 10.50.50.0/30. Defaultrouter on both servers looks to Wan.

I need that lan behind router A can connect to lan behind router B. Lan behind router B must looks like fakenet 10.30.0.0/16 to Lan A (I mean i want to connect from computer 10.20.1.1 behind router A to computer 10.20.1.1 behind router B and the last one must be accessible as 10.30.1.1)

I read some manuals and decide to make it with binat

Picture attached

On router A i wrote:


```
route add 10.30.0.0/16 10.50.50.2
```

On router B i wrote:

```
binat on $b_if from 10.20.0.0/16 to any -> 10.30.0.0/16
```

I can ping from router A any computer from B lan as 10.30.x.x, but i can't ping from A LAN computers.
I guess i doing something wrong, please help me to organize this. Thanks!


----------



## alfi (Oct 11, 2016)

Well, problem solved lol, who will be google by my steps i wrote on A router:


```
binat on $a_if from 10.20.0.0/16 to any -> 10.30.0.0/16
route add 10.30.0.0/16 10.50.50.2
```

On router B near the same:


```
binat on $b_if from 10.20.0.0/16 to any -> 10.30.0.0/16
route add 10.30.0.0/16 10.50.50.1
```

And ofc allow traffic with PF


----------

