Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firewall implementation and traffic forwarding #494

Open
p4pe opened this issue Jul 8, 2021 · 4 comments
Open

firewall implementation and traffic forwarding #494

p4pe opened this issue Jul 8, 2021 · 4 comments

Comments

@p4pe
Copy link

p4pe commented Jul 8, 2021

Hello everyone, I'm trying to implement a firewall in click and I m facing an issue.
Here is a schema:
firewall

And my click configuration

//Inputs and outputs
in::FromDevice(ens4, PROMISC true)
out::ToDevice(ens5)
//c::Counter;
//Classifier

cw::Classifier(
   12/0800, //IP packets
   -       // Other
);

// IP Filtering
f::IPFilter(
 0 src host 192.168.110.0 && ip proto 1 or ip proto 17,
 1 all);
cw[0]->CheckIPHeader(14)->f;
cw[1]->Print("The packet was dropped")->Discard
in->cw;
f[0]->IPPrint("pass")->Queue->out;
f[1]->Print("Discard")->Queue->Discard;

What I want to achieve is when I ping the address 192.168.110.119, then "firewall-vnf" should route the traffic to 192.168.109.23 (i.e. VM3)

I capture the traffic using tcpdump on the output interface (ens5) but as I expected the traffic is not traversing to 192.168.109.23

What else should add to the click configuration file in order to achieve this forwarding?
Or can I do this with iptables rules on the ens5 interface;

Thank you in advance

@ahenning
Copy link

ahenning commented Jul 9, 2021

Its probably worth looking at the Layer2 headers. The way I read the config the packets are going to leave ens5 with the same L2 headers as received on ens4, so even if the packet is forced onto the VM3 interface, VM3 will receive the packet with a destination mac that it probably does not own.

@p4pe
Copy link
Author

p4pe commented Jul 11, 2021

Thank you for your answer @ahenning.
So your suggestion is to change the MAC address before the packet exits the ens5?

@pallas
Copy link
Contributor

pallas commented Jul 11, 2021 via email

@p4pe
Copy link
Author

p4pe commented Jul 12, 2021

@pallas no, we assume that these are L3 interfaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants