unsigned int ifindex;
unsigned int master;
unsigned int proto;
+ unsigned int fdb;
} filter;
enum {
" ip nexthop { add | replace } id ID NH [ protocol ID ]\n"
" ip nexthop { get| del } id ID\n"
"SELECTOR := [ id ID ] [ dev DEV ] [ vrf NAME ] [ master DEV ]\n"
- " [ groups ]\n"
+ " [ groups ] [ fdb ]\n"
"NH := { blackhole | [ via ADDRESS ] [ dev DEV ] [ onlink ]\n"
" [ encap ENCAPTYPE ENCAPHDR ] | group GROUP ] }\n"
"GROUP := [ id[,weight]>/<id[,weight]>/... ]\n"
return err;
}
+ if (filter.fdb) {
+ err = addattr_l(nlh, reqlen, NHA_FDB, NULL, 0);
+ if (err)
+ return err;
+ }
+
return 0;
}
if (tb[NHA_OIF])
print_rt_flags(fp, nhm->nh_flags);
+ if (tb[NHA_FDB])
+ print_null(PRINT_ANY, "fdb", "fdb", NULL);
+
print_string(PRINT_FP, NULL, "%s", "\n");
close_json_object();
fflush(fp);
addattr_l(&req.n, sizeof(req), NHA_BLACKHOLE, NULL, 0);
if (req.nhm.nh_family == AF_UNSPEC)
req.nhm.nh_family = AF_INET;
+ } else if (!strcmp(*argv, "fdb")) {
+ addattr_l(&req.n, sizeof(req), NHA_FDB, NULL, 0);
} else if (!strcmp(*argv, "onlink")) {
nh_flags |= RTNH_F_ONLINK;
} else if (!strcmp(*argv, "group")) {
if (get_unsigned(&proto, *argv, 0))
invarg("invalid protocol value", *argv);
filter.proto = proto;
+ } else if (!matches(*argv, "fdb")) {
+ filter.fdb = 1;
} else if (matches(*argv, "help") == 0) {
usage();
} else {
.IR NAME " ] [ "
.B master
.IR DEV " ] [ "
-.BR groups " ] "
+.BR groups " ] [ "
+.BR fdb " ]"
.ti -8
.IR NH " := { "
.IR DEV " ] [ "
.BR onlink " ] [ "
.B encap
-.IR ENCAP " ] | "
+.IR ENCAP " ] [ "
+.BR fdb " ] | "
.B group
-.IR GROUP " } "
+.IR GROUP " [ "
+.BR fdb " ] } "
.ti -8
.IR ENCAP " := [ "
.TP
.B blackhole
create a blackhole nexthop
+.TP
+.B fdb
+nexthop and nexthop groups for use with layer-2 fdb entries.
+A fdb nexthop group can only have fdb nexthops.
+Example: Used to represent a vxlan remote vtep ip. layer-2 vxlan
+fdb entry pointing to an ecmp nexthop group containing multiple
+remote vtep ips.
.RE
.TP
.TP
.BI groups
show only nexthop groups
+.TP
+.BI fdb
+show only fdb nexthops and nexthop groups
.RE
.TP
ip nexthop flush
Adds a nexthop with id 4. The nexthop is a group using nexthops with ids
1 and 2 with nexthop 1 at weight 5 and nexthop 2 at weight 11.
.RE
+.PP
+ip nexthop add id 5 via 192.168.1.2 fdb
+.RS 4
+Adds a fdb nexthop with id 5.
+.RE
+.PP
+ip nexthop add id 7 group 5/6 fdb
+.RS 4
+Adds a fdb nexthop group with id 7. A fdb nexthop group can only have
+fdb nexthops.
+.RE
.SH SEE ALSO
.br
.BR ip (8)