Struct rtnetlink::VxlanAddRequest
source · pub struct VxlanAddRequest { /* private fields */ }
Expand description
A request to create a new vxlan link.
This is equivalent to ip link add NAME vxlan id ID ...
commands.
It provides methods to customize the creation of the vxlan interface
It provides almost all parameters that are listed by man ip link
.
Implementations§
source§impl VxlanAddRequest
impl VxlanAddRequest
sourcepub fn link(self, index: u32) -> Self
pub fn link(self, index: u32) -> Self
Adds the dev
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI dev LINK
,
dev LINK - specifies the physical device to use
for tunnel endpoint communication.
But instead of specifing a link name (LINK
), we specify a link index.
sourcepub fn port(self, port: u16) -> Self
pub fn port(self, port: u16) -> Self
Adds the dstport
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI dstport PORT
.
dstport PORT - specifies the UDP destination port to
communicate to the remote VXLAN tunnel endpoint.
sourcepub fn group(self, addr: Ipv4Addr) -> Self
pub fn group(self, addr: Ipv4Addr) -> Self
Adds the group
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI group IPADDR
,
group IPADDR - specifies the multicast IP address to join.
This function takes an IPv4 address
WARNING: only one between remote
and group
can be present.
sourcepub fn group6(self, addr: Ipv6Addr) -> Self
pub fn group6(self, addr: Ipv6Addr) -> Self
Adds the group
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI group IPADDR
,
group IPADDR - specifies the multicast IP address to join.
This function takes an IPv6 address
WARNING: only one between remote
and group
can be present.
sourcepub fn remote(self, addr: Ipv4Addr) -> Self
pub fn remote(self, addr: Ipv4Addr) -> Self
Adds the remote
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI remote IPADDR
,
remote IPADDR - specifies the unicast destination IP
address to use in outgoing packets when the
destination link layer address is not known in the
VXLAN device forwarding database.
This function takes an IPv4 address.
WARNING: only one between remote
and group
can be present.
sourcepub fn remote6(self, addr: Ipv6Addr) -> Self
pub fn remote6(self, addr: Ipv6Addr) -> Self
Adds the remote
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI remote IPADDR
,
remote IPADDR - specifies the unicast destination IP
address to use in outgoing packets when the
destination link layer address is not known in the
VXLAN device forwarding database.
This function takes an IPv6 address.
WARNING: only one between remote
and group
can be present.
sourcepub fn local(self, addr: Ipv4Addr) -> Self
pub fn local(self, addr: Ipv4Addr) -> Self
Adds the local
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI local IPADDR
,
local IPADDR - specifies the source IP address to use in outgoing packets.
This function takes an IPv4 address.
sourcepub fn local6(self, addr: Ipv6Addr) -> Self
pub fn local6(self, addr: Ipv6Addr) -> Self
Adds the local
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI local IPADDR
,
local IPADDR - specifies the source IP address to use in outgoing packets.
This function takes an IPv6 address.
sourcepub fn tos(self, tos: u8) -> Self
pub fn tos(self, tos: u8) -> Self
Adds the tos
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI tos TOS
.
tos TOS - specifies the TOS value to use in outgoing packets.
sourcepub fn ttl(self, ttl: u8) -> Self
pub fn ttl(self, ttl: u8) -> Self
Adds the ttl
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI ttl TTL
.
ttl TTL - specifies the TTL value to use in outgoing packets.
sourcepub fn label(self, label: u32) -> Self
pub fn label(self, label: u32) -> Self
Adds the flowlabel
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI flowlabel LABEL
.
flowlabel LABEL - specifies the flow label to use in outgoing packets.
sourcepub fn learning(self, learning: u8) -> Self
pub fn learning(self, learning: u8) -> Self
Adds the learning
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI [no]learning
.
[no]learning - specifies if unknown source link layer
addresses and IP addresses are entered into the VXLAN
device forwarding database.
sourcepub fn ageing(self, seconds: u32) -> Self
pub fn ageing(self, seconds: u32) -> Self
Adds the ageing
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI ageing SECONDS
.
ageing SECONDS - specifies the lifetime in seconds of
FDB entries learnt by the kernel.
sourcepub fn limit(self, limit: u32) -> Self
pub fn limit(self, limit: u32) -> Self
Adds the maxaddress
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI maxaddress LIMIT
.
maxaddress LIMIT - specifies the maximum number of
FDB entries.
sourcepub fn port_range(self, min: u16, max: u16) -> Self
pub fn port_range(self, min: u16, max: u16) -> Self
Adds the srcport
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI srcport MIN MAX
.
srcport MIN MAX - specifies the range of port numbers
to use as UDP source ports to communicate to the
remote VXLAN tunnel endpoint.
sourcepub fn proxy(self, proxy: u8) -> Self
pub fn proxy(self, proxy: u8) -> Self
Adds the proxy
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI [no]proxy
.
[no]proxy - specifies ARP proxy is turned on.
sourcepub fn rsc(self, rsc: u8) -> Self
pub fn rsc(self, rsc: u8) -> Self
Adds the rsc
attribute to the VXLAN
This is equivalent to ip link add name NAME type vxlan id VNI [no]rsc
.
[no]rsc - specifies if route short circuit is turned on.
sourcepub fn l2miss(self, l2miss: u8) -> Self
pub fn l2miss(self, l2miss: u8) -> Self
This is equivalent to ip link add name NAME type vxlan id VNI [no]l2miss
.
[no]l2miss - specifies if netlink LLADDR miss notifications are generated.
sourcepub fn l3miss(self, l3miss: u8) -> Self
pub fn l3miss(self, l3miss: u8) -> Self
This is equivalent to ip link add name NAME type vxlan id VNI [no]l3miss
.
[no]l3miss - specifies if netlink IP ADDR miss notifications are generated.