Answer the question
In order to leave comments, you need to log in
How to disable traffic between local(eth1) and virtual(eth1:0) interface?
There is a Linux-box with two network interfaces.
eth0 - inet
eth1 - lan (192.168.1.1)
eth1:0 - lan (192.168.2.1)
How can I prevent traffic from going between eth1 and eth1:0?
Tried:
iptables -I FORWARD -i eth1:0 -o eth1 -j DROP
iptables -I FORWARD -i eth1 -o eth1:0 -j DROP
Didn't work though.
Thank you all, I solved the problem by installing a separate network card.
Answer the question
In order to leave comments, you need to log in
I solved the problem by installing a separate network card, vlan was not suitable in this case.
in terms of iptables eth1 and eth1:0 - same interface
try like this
ip link add virtual0 link eth1 type macvlan mode bridge
ip addr add 192.168.2.1/24 dev virtual0
ip link set virtual0 up
iptables -I FORWARD -i virtual0 -o eth1 -j DROP
iptables -I FORWARD -i eth1 -o virtual0 -j DROP
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question