Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi All
I am building a network topology,and I need to make macvlan work with bridge.
eth0 is connected to ISP link with subnet 100.100.100.0/24
eth1 is connected to my PC with PC's IP= 100.100.100.40
================================================================
Case1:
/sbin/brctl addbr br0
/sbin/brctl stp br0 on
/sbin/brctl addif br0 eth0
/sbin/brctl addif br0 eth1
/sbin/ifconfig br0 up
/sbin/ip addr add 100.100.100.45/24 dev br0
/sbin/ip route add 100.100.100.1 dev br0
/sbin/ip route add 100.100.100.1 dev br0 table 1001
/sbin/ip route add default via 100.100.100.1 dev br0 table 1001
PC 's traffic can go to internet with NATed IP 100.100.100.45 , but it is not what I want...I want to use macvlan,it is easy to calcute the bandwidth usage.
================================================================
Case2:
/sbin/brctl addbr br0
/sbin/brctl stp br0 on
/sbin/brctl addif br0 eth0
/sbin/brctl addif br0 eth1
/sbin/ifconfig br0 up
/sbin/ip link add link br0 br0_2 address 00:00:00:6B:E7:E0 type macvlan
/sbin/ifconfig br0_2 up
/sbin/ip addr add 100.100.100.45/24 dev br0_2
/sbin/ip route add 100.100.100.1 dev br0_2
/sbin/ip route add 100.100.100.1 dev br0_2 table 1001
/sbin/ip route add default via 100.100.100.1 dev br0_2 table 1001
PC's traffic can go to internet and can't do NAT to 100.100.100.45.
PC can only use 100.100.100.40 to access internet
I want traffic can go through br0_2 and do nat to 100.100.100.45 , is it possible?
================================================================Case3:
/sbin/ip link add link eth0 eth0_5 address 00:00:00:c4:75:9e type macvlan
/sbin/ifconfig eth0_5 up
/sbin/ip link add link eth1 eth1_4 address 00:00:00:5e:bb:4e type macvlan
/sbin/ifconfig eth1_4 up
/sbin/brctl addbr br0
/sbin/brctl stp br0 on
/sbin/brctl addif br0 eth0_5
/sbin/brctl addif br0 eth1_4
/sbin/ifconfig br0 up
/sbin/ip addr add 100.100.100.45/24 dev br0
/sbin/ip route add 100.100.100.1 dev br0
/sbin/ip route add 100.100.100.1 dev br0 table 1001
/sbin/ip route add default via 100.100.100.1 dev br0 table 1001
Hi nini09
I want to create a DMZ Zone on my linux router(the role is like a firewall+L3 switch) which can make servers be accessed from internet directly.
But if servers in DMZ Zone to access internet,I need the servers to do SNAT to other IPs.
Internet <=> Linux Router do Bridge <=> LAN Servers
Normally in bridge mode, packet doesn't go to layer 3, IP layer. Just in layer 2, MAC layer. So iptable tool didn't work.
You can try following command to force packet to go through layer 3.
net.bridge.bridge-nf-call-iptables=1
net.bridge.bridge-nf-call-arptables=0
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.