Commit Graph

96 Commits

Author SHA1 Message Date
Lorenz Brun
306ce7b5b2 Add field for permanent hardware address
Linux 5.6 and higher support IFLA_PERM_ADDRESS, which contains the
permanent hardware address of the interface if an interface has such an
address. This can be used to identify interfaces even when the normal
hardware address has been changed.

Signed-off-by: Lorenz Brun <lorenz@monogon.tech>
2024-03-29 14:43:07 -07:00
konradh
0e685ffcfc link: add don't fragment support to Geneve 2024-03-20 14:21:27 -07:00
konradh
9453b0562a link: add INNER_PROTO_INHERIT support for Geneve 2024-03-20 14:21:27 -07:00
Sebastian Sch
a008cbde48 Add support for alternative names
This commit add the support for alternative names.

* exposing the attributes in the link object.
* adding the add and delete functions
* allow LinkByName() to also find devices by altname like `ip link`

Signed-off-by: Sebastian Sch <sebassch@gmail.com>
2024-02-20 15:41:36 -08:00
tc
f1333cd79a support netkit
netkit device is merged to Linux upstream:
https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=22360fad5889cbefe1eca695b0cc0273ab280b56

this PR add support to manage a netkit device in Golang

authored-by: tangchen <tangchen.1@bytedance.com>
2023-11-27 10:22:01 -08:00
Marcelo Guerrero
63484bbf69 Add support to manage the vlan protocol on a vf
This allows users to get and set the vlan protocol on a vf
Signed-off-by: Marcelo Guerrero <marguerr@redhat.com>
2023-09-05 08:20:06 -07:00
Robin Gögge
88c0defd46 Add FlowBased support for Ip6tnl
Ip6tnl devices support IFLA_IPTUN_COLLECT_METADATA (collect_md/external
mode). This commit adds support for this and a respective test.

Signed-off-by: Robin Gögge <r.goegge@isovalent.com>
2023-07-14 14:08:02 +02:00
Daniel Borkmann
a8a91c0504 link: add TSOMaxSize and TSOMaxSegs to link attributes
This is a read-only netlink attribute which has been added in 5.19
kernel. This is useful to query in order to probe if a given driver
supports IPv6 BIG TCP.

  [0] https://lore.kernel.org/netdev/20220513183408.686447-2-eric.dumazet@gmail.com/

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2023-06-16 08:52:39 -07:00
Daniel Borkmann
2b008399a4 link: add LinkSetGSOIPv4MaxSize and LinkSetGROIPv4MaxSize
Add two new methods to allow setting GSO and GRO max size attributes only.
They make it much easier to enable IPv4 BIG TCP [0].

The equivalent iproute2 commands are:

$ ip link set $link gso_ipv4_max_size $maxSize
$ ip link set $link gro_ipv4_max_size $maxSize

Also add tests for them. We already do support the IPv6 counterpart via
543bb1cade ("link: add LinkSetGSOMaxSize and LinkSetGROMaxSize").

  [0] https://lore.kernel.org/netdev/cover.1674921359.git.lucien.xin@gmail.com/

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
2023-06-14 23:26:06 -07:00
Marcelo Guerrero Viveros
55c8b9515a Add support for setting default vlan on a bridge
This pr allows to change the default vlan on a bridge. It is
currently set to 1 by default. A value of 0 means no default vlan.

Signed-off-by: Marcelo Guerrero Viveros <marguerr@redhat.com>
2023-04-20 10:47:44 -07:00
Eyal Birger
7e7feb220f link: Add FlowBased support to Gretun
GRE L3 devices support "FlowBased" ("collect_md"/"external") mode.
Add support for this configuration and relevant test.

Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
2022-08-02 12:16:27 +02:00
Nikolay Aleksandrov
c94808a88b link: add support for IFLA_GRO_MAX_SIZE
Add support for the new IFLA_GRO_MAX_SIZE attribute which is needed to
enable BIG TCP[1] properly. Define the attribute in the local link
attributes (nl/link_linux.go) because it isn't yet present in Go's
x/sys/unix package. Also add a test for it.

[1] https://patchwork.kernel.org/project/netdevbpf/cover/20220513183408.686447-1-eric.dumazet@gmail.com/

Signed-off-by: Nikolay Aleksandrov <razor@blackwall.org>
2022-06-02 16:02:03 -07:00
Tao Li
f24382625b add proto field to Iptun 2022-02-17 12:20:32 -06:00
conjones
76d8bfe0aa Adds ip6tunnel encap types, encap flags, and flags 2022-01-12 19:00:49 -06:00
bersoare
7992ad9959 add support for bareudp link type 2021-09-17 10:14:18 -07:00
Dennis Afanasev
21f2c55a77 Add PHYS_SWITCH_ID attribute to LinkAttrs 2021-07-03 11:55:58 +02:00
dennisafa
d1e684a60b Ability to set multicast attribute on a link 2021-05-30 12:51:51 +02:00
Riccardo Manfrin
af1e63ea7b Adds vrf slave link slave data parse 2021-05-10 07:22:18 -07:00
Bjorn Svensson
6063cc66d7 Add allmulti to link attributes
Provide the status of the allmulticast option via the highlevel
link attributes instead of requiring raw flag handling.

Avoid comparing all rawflags before and after in tests due to that
the IFF_RUNNING flag might change independenly.

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
2021-05-08 09:10:00 -07:00
Wei Yang
aa68aabe05 Add ipvtap link support
ipvtap is a similar link type as ipvlan with tap interface.

This patch enables it just like macvtap.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
2021-05-08 08:48:48 -07:00
Riccardo Manfrin
ec93726159 Adds strings translation methods
RTPROT_KEEPALIVED is commented to interop with earlier go versions (1.13, 1.14)
2021-03-04 14:52:04 -08:00
Stephen Hassard
d185ffdb62 Add Geneve link support
Heavily based on the existing Gretap support
2020-11-21 23:35:49 -08:00
lmbsog0
c7261bd9e0 add support for CAN 2020-11-20 12:42:29 -08:00
Riccardo Manfrin
8b655377ac Allows direct usage of String() method 2020-11-19 09:59:55 -08:00
root
e30b76407c VF stats struct and deserialization method added. VfStats now reported in the VfInfo struct
Co-authored-by: PatrickKutch <patrick.kutch@gmail.com>
2020-10-19 15:29:26 -04:00
Konstantin Baranov
337442361b Allow placing veth peer into a namespace
Creating a veth pair across namespaces now is a multistep process.
Doing it in one shot with this change is clearer as current
namespace never sees peer IF. Also, moving peer into a namespace
may be rather slow, so better avoided.
2020-09-14 10:57:23 -04:00
Dennis Marttinen
9690c54307 Add support for configuring bridge ageing time
Signed-off-by: Dennis Marttinen <dennis@weave.works>
2020-09-14 10:49:43 -04:00
Julian Kornberger
01e0a49c1f Add additional fields to link.Ip6tnl
and optimize aligment of Sittun fields
2020-09-14 10:42:05 -04:00
Sylvain Baubeau
fe26ba2db0 Set default values for link attributes
When deserializing a link related netlink message, if no network namespace id
attribute is specified, we need to set it to -1 otherwise it defaults to 0
which is a valid id. Using NewLinkAttrs sets the default values and allows
the user to distinguish an empty value from a missing value
2020-09-14 10:41:08 -04:00
Dmitrii Okunev
dc0e1b988c feature: Add wireguard link type
Added type "Wireguard" which implements link type "wireguard".

See also https://www.wireguard.com/

Signed-off-by: Dmitrii Okunev <xaionaro@fb.com>
2020-06-04 09:01:02 -07:00
Konstantin Belyalov
b2372689b9 Save XDP attach mode into LinkXdp. 2020-01-27 15:47:19 -08:00
Oleg Senin
6b3a223c53 Add ip6tnl support 2019-09-24 13:56:29 -07:00
Takushi Fujiwara
205a160d2e Add bond slave information
This PR refers to PR@lebauce and add some changes.
- Added some tests to retrieve bond slave information.
- Link.BondSlave is changed to LinkSlave interface.
- BondSlaveState.String() returns UPPER case. (same as iproute2)
- BondSlaveMiiStatus.String() returns UPPER case. (same as iproute2)
2019-09-16 08:52:39 -07:00
Adrian Chiris
46ae81cf70 Add support for IPoIB interfaces
- Add a new Link type, IPoIB, that exposes the following IPoIB attributes:
    * IFLA_IPOIB_PKEY
    * IFLA_IPOIB_MODE
    * IFLA_IPOIB_UMCAST
- Suppport Deserialize for IPoIB link attributes in LinkDeserialize()
- Support IPoIB attributes in LinkAdd()
2019-08-12 04:46:40 -07:00
Adrian Chiris
28720742a4 Add support for IFLA_VF_RATE
Today netlink package supports Get/Set of a VF's max TX rate
via IFLA_VF_TX_RATE netlink attribute.

This patch add support to Get/Set of a VFs min and max TX rate
via IFLA_VF_RATE netlink attribute.

- Add support to set min/max tx rate for VF via IFLA_VF_RATE
- Added IFLA_VF_RATE min/max tx rate attributes to netlink.VfInfo
  including parsing support in netlink.parseVfInfo()

NOTE: According to [1] IFLA_VF_RATE takes precedence over
      IFLA_VF_TX_RATE. Dealing with the co-existance of these
      netlink attributes is left for the user to handle.

[1]https://lists.openwall.net/netdev/2014/05/22/42
2019-07-25 03:38:53 +02:00
bingshen.wbs
14bd2e6fd2 support ipvlan flag
Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
2019-07-25 03:37:08 +02:00
Anton Aksola
df01369528 add support for link groups (IFLA_GROUP) 2019-07-13 20:34:27 -07:00
Martynas Pumputis
99a56c251a veth: Set peer hardware addr when creating
This commit extends LinkAdd function for Veth by allowing to specify
peer hardware addr.

Signed-off-by: Martynas Pumputis <m@lambda.lt>
2019-06-18 07:33:17 -07:00
Archana Shinde
db99c040b9 tuntap: Return TunTapLink instead of GenericLink
For tuntap interfaces, return a TunTap Interface instead of
a Generic link when retrieving the interface.
Use netlink extended attributes to populate the Link attributes
for the tuntap link.
In case of older tun driver which does not provide these
attributes, use sysfs to retrieve these attributes.

This commit also adds Owner and Group attributes for the TunTap
Link.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2019-06-03 12:01:21 -07:00
soyking
fafc1e7b60 support vlan protocol 2019-05-03 14:23:34 -07:00
Andrei Vagin
adb577d4a4 Add support for IFLA_GSO_*
IFLA_GSO_MAX_SIZE - maximum GSO segment size
IFLA_GSO_MAX_SEGS - maximum number of GSO segments

Signed-off-by: Andrei Vagin <avagin@google.com>
2019-03-17 17:31:49 -07:00
Matt Ellison
1e2e7ab670 Add Support for Virtual XFRM Interfaces
XFRM interfaces are available in Linux Kernel 4.19+

When an IF_ID is applied to a XFRM policy and state, the corresponding
traffic will be sent through the virtual interface with the same IF_ID.
2019-01-05 11:40:40 -08:00
Div Arora
0bbc55bea9 Initial support for vlan aware bridges. 2018-07-23 11:15:57 -07:00
Ralph Schmieder
d85e18ed5b Allow Tuntap non-persist, allow empty tuntap name
chg: addtl comment and made minor logic optimization as disscussed in PR #296
chg: flipped Persist to NonPersist
chg: comments, only unpersist tuntap if flag is set
chg: tuntap persist optional, allow empty intfc name
chg: added conditional build
Signed-off-by: Ralph Schmieder <ralph.schmieder@gmail.com>
2018-07-16 09:40:17 -07:00
semicomplete
ee06b1df73 add vti6 support
Signed-off-by: semicomplete <example@example.com>
2018-06-19 08:48:34 -07:00
Piotr Skamruk
5f662e0500 Add info about VFs on link 2018-05-10 08:45:05 -07:00
Alessandro Boch
5a988e882d Support IPv6 GRE Tun and Tap
Signed-off-by: Alessandro Boch <aboch@tetrationanalytics.com>
2018-01-19 09:48:20 -08:00
Luke Granger-Brown
016ba6f67a Add support for managing source MACVLANs 2017-11-27 22:19:10 -08:00
Manohar Castelino
c2a3de3b38 tuntap: Add multiqueue support
Add multi queue support to tuntap without breaking legacy users
of tuntap.

Signed-off-by: Manohar Castelino <manohar.r.castelino@intel.com>
2017-11-13 20:19:46 -08:00
Tomofumi Hayashi
e104583c52 Support num{tx,rx}queues and udp6zerocsum{tx,rx}
Add IFLA_NUM_TX_QUEUES and IFLA_NUM_RX_QUEUES in link attribute and
IFLA_VXLAN_UDP_ZERO_CSUM6_TX and IFLA_VXLAN_UDP_ZERO_CSUM6_RX in VXLAN
attribute.
2017-11-13 20:19:27 -08:00