routing base on src ip

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

routing base on src ip

Sébastien Morand

I'm having a little trouble with routing rule based on source ip address.

Here is small description of my network:

  |------|       |------|
  | lan3 |       | lan2 |
  |------|       |------|
     |               |
|---------|     |---------|     |------|
| router1 |-----| router2 |-----| lan1 |
|---------|     |---------|     |------|
     |               |
 internet        internet

Iwould like to redirect some of lan1 computers by router1 for internet

on the routers on router1 (interface vlan1) is talking to on router2 (interface vlan1)
lan1 is (vlan0 on router2)
lan2 is (vlan2 on router2)
lan3 is (vlan0 on router1)

I try the following pf rule:
nolocalnets="{ ! }"
pass in quick from $specialip to $nolocalnets route-to {(vlan1}

but this is not working (blocked on syn_sent).

No packet seen on router1 with tcpdump. It's seen on vlan0 on router2 but
not in vlan1, so what I missing?

Thanks by advance,