0

I have two minimal embedded devices that has ip, ipconfig, nat, etc support. The embedded devices share network over USB. I want to configure each board so that they have two seperate interfaces, macvlan0 for internet connection, macvlan1 for internal communication between these boards. See below:

           macvlan0---                        -----macvlan0
                     |                        |
eth0 ---   Board 1   |--usb0 --------- usb0 --| Board 2
                     |                        |
           macvlan1---                        -----macvlan1

I have read online that this could be achieved using Linux's existing MACVLAN architecture. So far, I have set up the interfaces, but unable to make it so that macvlan0 is used for internet connection, macvlan1 is used for internet communication (able to ping each other, but not connected to internet)

ip link add macvlan0 link usb0 type macvlan
ip link set dev macvlan0 mtu 1380
ifconfig macvlan0 10.0.1.3 netmask 255.255.255.0 up
ip link add macvlan0 link usb0 type macvlan
ip link set dev macvlan0 mtu 1380
ifconfig macvlan1 10.0.1.4 netmask 255.255.255.0 up

Any ideas how to proceed is greately appreciated.

EDIT:

I would like to have

  • macvlan0's be able to ping 8.8.8.8, also each other, but not macvlan1's
  • macvlan1's be able to ping each other, not be able to ping 8.8.8.8 or macvlan0's
  • @A.B I have edited the question what I really would want to achieve. Please check it. – mozcelikors May 13 at 5:43
  • noted. Still looks too complex for me. I might be wrong, but it looks to me like a XY problem. You should read about it: What is the XY problem?. – A.B May 13 at 6:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.