"Usage: ... %s mode MODE [flag MODE_FLAG] MODE_OPTS [bcqueuelen BC_QUEUE_LEN]\n"
"\n"
"MODE: private | vepa | bridge | passthru | source\n"
- "MODE_FLAG: null | nopromisc\n"
+ "MODE_FLAG: null | nopromisc | nodst\n"
"MODE_OPTS: for mode \"source\":\n"
"\tmacaddr { { add | del } <macaddr> | set [ <macaddr> [ <macaddr> ... ] ] | flush }\n"
"BC_QUEUE_LEN: Length of the rx queue for broadcast/multicast: [0-4294967295]\n",
static int flag_arg(const char *arg)
{
fprintf(stderr,
- "Error: argument of \"flag\" must be \"nopromisc\" or \"null\", not \"%s\"\n",
+ "Error: argument of \"flag\" must be \"nopromisc\", \"nodst\" or \"null\", not \"%s\"\n",
arg);
return -1;
}
if (strcmp(*argv, "nopromisc") == 0)
flags |= MACVLAN_FLAG_NOPROMISC;
+ else if (strcmp(*argv, "nodst") == 0)
+ flags |= MACVLAN_FLAG_NODST;
else if (strcmp(*argv, "null") == 0)
flags |= 0;
else
} else if (matches(*argv, "nopromisc") == 0) {
flags |= MACVLAN_FLAG_NOPROMISC;
has_flags = 1;
+ } else if (matches(*argv, "nodst") == 0) {
+ flags |= MACVLAN_FLAG_NODST;
+ has_flags = 1;
} else if (matches(*argv, "bcqueuelen") == 0) {
__u32 bc_queue_len;
NEXT_ARG();
if (flags & MACVLAN_FLAG_NOPROMISC)
print_bool(PRINT_ANY, "nopromisc", "nopromisc ", true);
+ if (flags & MACVLAN_FLAG_NODST)
+ print_bool(PRINT_ANY, "nodst", "nodst ", true);
+
if (tb[IFLA_MACVLAN_BC_QUEUE_LEN] &&
RTA_PAYLOAD(tb[IFLA_MACVLAN_BC_QUEUE_LEN]) >= sizeof(__u32)) {
__u32 bc_queue_len = rta_getattr_u32(tb[IFLA_MACVLAN_BC_QUEUE_LEN]);
.BI "ip link add link " DEVICE " name " NAME
.BR type " { " macvlan " | " macvtap " } "
.BR mode " { " private " | " vepa " | " bridge " | " passthru
-.RB " [ " nopromisc " ] | " source " } "
+.RB " [ " nopromisc " ] | " source " [ " nodst " ] } "
.RB " [ " bcqueuelen " { " LENGTH " } ] "
.in +8
.BR nopromisc " flag prevents this, so the promisc flag may be controlled "
using standard tools.
-.B mode source
+.BR mode " " source " [ " nodst " ] "
- allows one to set a list of allowed mac address, which is used to match
against source mac address from received frames on underlying interface. This
allows creating mac based VLAN associations, instead of standard port or tag
based. The feature is useful to deploy 802.1x mac based behavior,
-where drivers of underlying interfaces doesn't allows that.
+where drivers of underlying interfaces doesn't allows that. By default, packets
+are also considered (duplicated) for destination-based MACVLAN. Passing the
+.BR nodst " flag stops matching packets from also going through the "
+destination-based flow.
.BR bcqueuelen " { " LENGTH " } "
- Set the length of the RX queue used to process broadcast and multicast packets.