1

I am using a wrt54gl with openwrt to try and redirect all traffic on my LAN to a specific server, which will run scapy and other network analysis tools and act as a gateway/firewall to the Internet.

So far, I have managed to redirect all LAN traffic to my server by using a firewall rule :

config 'redirect'
    option 'src' 'lan'
    option 'dest_ip' '192.168.1.54'  

It works, and I am able to pick up packets with scapy on the server. But now my problem is that the data from my gateway/analysis server is being redirected as well, to itself.

I am looking for a way to exclude the server's IP from the redirect rule, I have tried with the '!' operand, but the firewall returns an error and does not take it into account.

I have also tried to put my server in a DMZ, following the openwrt howto. I wanted to be able to make firewall rules based on vlans, but I cannot seem to be able to access the internet from the DMZ and the first vlan cannot access the DMZ either. I am surely making an error somewhere but I don't see where

If you have a solution either by firewall rules or vlan or else, I would be very grateful, as I have been struggling with this for the last three days.

Thanks a lot.

charles
  • 11
  • 2

1 Answers1

0

The easiest way is to add a rule for the IP that you want to handle differently and make sure it gets evalluated first. So, before the rule you posted, add:

config redirect:
   option src 'lan'
   option src_ip '<MY_SERVER_IP>'
   option src_dip '192.168.1.54'
   option dest_ip '<MY_DEFAULT_GATEWAY>'
Niko
  • 101
  • 2