PF: NAT, Bridge on the same machine

So far on the router(on freebsd) was set Nat between rl0 (wan) and rl1 (lan). Unfortunately I need to connect one computer directly to router by next network card. I put it in to machine and set bridge between rl1(this card has address) and rl2 (new card). On pf I allowed trafic on rl2.
The problem is that computers behind rl2 can ping gatway which is rl1 but cant ping computers behind rl1. In "clear bridge" when none of card has address (rl1 rl2) then connections beetwen computers behind rl1 and rl2 are possible but of course there is no access to WAN.

How to make working bridge between r1(gate/lan side) and rl2 (free) and NAT between rl0(wan) and rl1 ?
 
You have 3 lans (wan, lan1, lan2) and you want that lan1 will be communicate with lan2? If I am understood you correct you don't need bridge.
 
Code:
rl0 (internet) ---NAT ---- rl1 --> LAN
                       | 
                       |
                      rl2 -------> LAN

between rl1 and rl2 I'd like to make bridge.

Lan which goes out from rl1 and rl2 is the same network (I want it to be)

ps. wlan? I mean WAN :p

####EDITED####

I've set bridge on rl1 and rl2 and address for it (bridge0):

Code:
#ifconfig bridge0 addm rl1 addm rl2 up
#ifconfig rl1 up
#ifconfig rl2 up
#ifconfig bridge0 inet 192.168.0.100/24
In general it's sick! After this configuration I was not able to connect to bridge. Only when I diseabled pf I was able to reach machine. What is more I can ping server from any card: rl1 or rl2 but when I try to ping from server I cant... It seems like enablig pf is disenabling bridge. I need to mix NAT with bridge. Maybe there are other solutions?
 
NAT works on layer 3 and a bridge works on layer 2. Learn a bit about TCP/IP and you'll notice that it isn't the best of solutions you thought of.

What exactly are you trying to archive?
 
Unfortunately I dont have another switch. I'm trying to connect one computer directly into FreeBSD machine and I want it to be a member of existing LAN.

I got the idea to connect this one computer as diffrent subnet. Next problem is - how to configure altq to shape traffic so that the sum of download traffic from rl1 and rl2 was the sum of download of rl0 (WAN). In my pf.conf altq is assgined to particular interface with particular bandwidth.

14MBBgUe2dBfCke6yTHlyU4A5ewVzr.png
 
Can you give me some tips? I'm little confused about difference between Nat and route.

Now I have two networks at rl1 and rl2. rl1 - 10.0.0.0/24 and rl2 - 192.168.0.0/24. Only way what I saw to communicate computers together in this networks was Nat on rl1 and rl2. I think there are better way to do this? am I right?
 
Ok I found this book but I still don't know what I really need. I tought that you meant fastroute or route-to - but it doesn't work.
 
Ok everything works. The problem was that I've been pinging small home router but it has no route to default gateway in case to response to computer from different network.
 
Back
Top