Pseudo Ethernet/MACVLAN

Pseudo-Ethernet or MACVLAN interfaces can be seen as subinterfaces to regular ethernet interfaces. Each and every subinterface is created a different media access control (MAC) address, for a single physical Ethernet port. Pseudo- Ethernet interfaces have most of their application in virtualized environments,

By using Pseudo-Ethernet interfaces there will be less system overhead compared to running a traditional bridging approach. Pseudo-Ethernet interfaces can also be used to workaround the general limit of 4096 virtual LANs (VLANs) per physical Ethernet port, since that limit is with respect to a single MAC address.

Every Virtual Ethernet interfaces behaves like a real Ethernet interface. They can have IPv4/IPv6 addresses configured, or can request addresses by DHCP/ DHCPv6 and are associated/mapped with a real ethernet port. This also makes Pseudo-Ethernet interfaces interesting for testing purposes. A Pseudo-Ethernet device will inherit characteristics (speed, duplex, …) from its physical parent (the so called link) interface.

Once created in the system, Pseudo-Ethernet interfaces can be referenced in the exact same way as other Ethernet interfaces. Notes about using Pseudo- Ethernet interfaces:

  • Pseudo-Ethernet interfaces can not be reached from your internal host. This means that you can not try to ping a Pseudo-Ethernet interface from the host system on which it is defined. The ping will be lost.
  • Loopbacks occurs at the IP level the same way as for other interfaces, ethernet frames are not forwarded between Pseudo-Ethernet interfaces.
  • Pseudo-Ethernet interfaces may not work in environments which expect a NIC to only have a single address. This applies to: - VMware machines using default settings - Network switches with security settings allowing only a single MAC address - xDSL modems that try to lear the MAC address of the NIC

Configuration

Common interface configuration

set interfaces pseudo-ethernet <interface> address <address | dhcp | dhcpv6>

Configure interface <interface> with one or more interface addresses.

  • address can be specified multiple times as IPv4 and/or IPv6 address, e.g. 192.0.2.1/24 and/or 2001:db8::1/64
  • dhcp interface address is received by DHCP from a DHCP server on this segment.
  • dhcpv6 interface address is received by DHCPv6 from a DHCPv6 server on this segment.

Example:

set interfaces pseudo-ethernet peth0 address 192.0.2.1/24
set interfaces pseudo-ethernet peth0 address 2001:db8::1/64
set interfaces pseudo-ethernet peth0 dhcp
set interfaces pseudo-ethernet peth0 dhcpv6
set interfaces pseudo-ethernet <interface> description <description>

Set a human readable, descriptive alias for this connection. Alias is used by e.g. the show interfaces command or SNMP based monitoring tools.

Example:

set interfaces pseudo-ethernet peth0 description 'This is an awesome interface running on VyOS'
set interfaces pseudo-ethernet <interface> disable

Disable given <interface>. It will be placed in administratively down (A/D) state.

Example:

set interfaces pseudo-ethernet peth0 disable
set interfaces pseudo-ethernet <interface> disable-flow-control

Ethernet flow control is a mechanism for temporarily stopping the transmission of data on Ethernet family computer networks. The goal of this mechanism is to ensure zero packet loss in the presence of network congestion.

The first flow control mechanism, the pause frame, was defined by the IEEE 802.3x standard.

A sending station (computer or network switch) may be transmitting data faster than the other end of the link can accept it. Using flow control, the receiving station can signal the sender requesting suspension of transmissions until the receiver catches up.

Use this command to disable the generation of Ethernet flow control (pause frames).

Example:

set interfaces pseudo-ethernet peth0 disable-flow-control
set interfaces pseudo-ethernet <interface> disable-link-detect

Use this command to direct an interface to not detect any physical state changes on a link, for example, when the cable is unplugged.

Default is to detects physical link state changes.

Example:

set interfaces pseudo-ethernet peth0 disable-link-detect
set interfaces pseudo-ethernet <interface> mac <xx:xx:xx:xx:xx:xx>

Configure user defined MAC address on given <interface>.

Example:

set interfaces pseudo-ethernet peth0 mac '00:01:02:03:04:05'
set interfaces pseudo-ethernet <interface> mtu <mtu>

Configure MTU on given <interface>. It is the size (in bytes) of the largest ethernet frame sent on this link.

Example:

set interfaces pseudo-ethernet peth0 mtu 9000
set interfaces pseudo-ethernet <interface> ipv6 address autoconf

SLAAC RFC 4862. IPv6 hosts can configure themselves automatically when connected to an IPv6 network using the Neighbor Discovery Protocol via ICMPv6 router discovery messages. When first connected to a network, a host sends a link-local router solicitation multicast request for its configuration parameters; routers respond to such a request with a router advertisement packet that contains Internet Layer configuration parameters.

Note

This method automatically disables IPv6 traffic forwarding on the interface in question.

Example:

set interfaces pseudo-ethernet peth0 ipv6 address autoconf
set interfaces pseudo-ethernet <interface> ipv6 address eui64 <prefix>

EUI-64 as specified in RFC 4291 allows a host to assign iteslf a unique 64-Bit IPv6 address.

set interfaces pseudo-ethernet peth0 ipv6 address eui64 2001:db8:beef::/64
set interfaces pseudo-ethernet <interface> vrf <vrf>

Place interface in given VRF instance.

See also

There is an entire chapter about how to configure a VRF, please check this for additional information.

Example:

set interfaces pseudo-ethernet peth0 vrf red

DHCP(v6)

set interfaces pseudo-ethernet <interface> dhcp-options client-id <description>

RFC 2131 states: The client MAY choose to explicitly provide the identifier through the ‘client identifier’ option. If the client supplies a ‘client identifier’, the client MUST use the same ‘client identifier’ in all subsequent messages, and the server MUST use that identifier to identify the client.

Example:

set interfaces pseudo-ethernet peth0 dhcp-options client-id 'foo-bar'
set interfaces pseudo-ethernet <interface> dhcp-options host-name <hostname>

Instead of sending the real system hostname to the DHCP server, overwrite the host-name with this given-value.

Example:

set interfaces pseudo-ethernet peth0 dhcp-options host-name 'VyOS'
set interfaces pseudo-ethernet <interface> dhcp-options vendor-class-id <vendor-id>

The vendor-class-id option can be used to request a specific class of vendor options from the server.

Example:

set interfaces pseudo-ethernet peth0 dhcp-options vendor-class-id 'VyOS'
set interfaces pseudo-ethernet <interface> dhcp-options no-default-route

Only request an address from the DHCP server but do not request a default gateway.

Example:

set interfaces pseudo-ethernet peth0 dhcp-options no-default-route
set interfaces pseudo-ethernet <interface> dhcpv6-options parameters-only

This statement specifies dhcp6c to only exchange informational configuration parameters with servers. A list of DNS server addresses is an example of such parameters. This statement is useful when the client does not need stateful configuration parameters such as IPv6 addresses or prefixes.

set interfaces pseudo-ethernet peth0 dhcpv6-options parameters-only
set interfaces pseudo-ethernet <interface> dhcpv6-options rapid-commit

When rapid-commit is specified, dhcp6c will include a rapid-commit option in solicit messages and wait for an immediate reply instead of advertisements.

set interfaces pseudo-ethernet peth0 dhcpv6-options rapid-commit
set interfaces pseudo-ethernet <interface> dhcpv6-options temporary

Request only a temporary address and not form an IA_NA (Identity Association for Non-temporary Addresses) partnership.

set interfaces pseudo-ethernet peth0 dhcpv6-options temporary

DHCPv6 Prefix Delegation (PD)

VyOS 1.3 (equuleus) supports DHCPv6-PD (RFC 3633). DHCPv6 Prefix Delegation is supported by most ISPs who provide native IPv6 for consumers on fixed networks.

set interfaces pseudo-ethernet <interface> None None None None dhcpv6-option pd <id> length <length>

Some ISPs by default only delegate a /64 prefix. To request for a specific prefix size use this option to request for a bigger delegation for this pd <id>. This value is in the range from 32 - 64 so you could request up to a /32 prefix (if your ISP allows this) down to a /64 delegation.

The default value corresponds to 64.

To request a /56 prefix from your ISP use:

set interfaces pseudo-ethernet peth0 None None None None dhcpv6-options pd 0 length 56
set interfaces pseudo-ethernet <interface> None None None None dhcpv6-option pd <id> interface <delegatee> address <address>

Specify the interface address used locally on the interfcae where the prefix has been delegated to. ID must be a decimal integer.

It will be combined with the delegated prefix and the sla-id to form a complete interface address. The default is to use the EUI-64 address of the interface.

Example: Delegate a /64 prefix to interface eth8 which will use a local address on this router of <prefix>::ffff, as the address 65534 will correspond to ffff in hexadecimal notation.

set interfaces pseudo-ethernet peth0 None None None None dhcpv6-option pd 0 interface eth8 address 65534
set interfaces pseudo-ethernet <interface> None None None None dhcpv6-option pd <id> interface <delegatee> sla-id <id>

Specify the identifier value of the site-level aggregator (SLA) on the interface. ID must be a decimal number greater then 0 which fits in the length of SLA IDs (see below).

Example: If ID is 1 and the client is delegated an IPv6 prefix 2001:db8:ffff::/48, dhcp6c will combine the two values into a single IPv6 prefix, 2001:db8:ffff:1::/64, and will configure the prefix on the specified interface.

set interfaces pseudo-ethernet peth0 None None None None dhcpv6-option pd 0 interface eth8 sla-id 1

Pseudo Ethernet/MACVLAN options

set interfaces pseudo-ethernet <interface> source-interface <ethX>
Specifies the physical <ethX> Ethernet interface associated with a Pseudo Ethernet <interface>.

VLAN

IEEE 802.1q, often referred to as Dot1q, is the networking standard that supports virtual LANs (VLANs) on an IEEE 802.3 Ethernet network. The standard defines a system of VLAN tagging for Ethernet frames and the accompanying procedures to be used by bridges and switches in handling such frames. The standard also contains provisions for a quality-of-service prioritization scheme commonly known as IEEE 802.1p and defines the Generic Attribute Registration Protocol.

Portions of the network which are VLAN-aware (i.e., IEEE 802.1q conformant) can include VLAN tags. When a frame enters the VLAN-aware portion of the network, a tag is added to represent the VLAN membership. Each frame must be distinguishable as being within exactly one VLAN. A frame in the VLAN-aware portion of the network that does not contain a VLAN tag is assumed to be flowing on the native VLAN.

The standard was developed by IEEE 802.1, a working group of the IEEE 802 standards committee, and continues to be actively revised. One of the notable revisions is 802.1Q-2014 which incorporated IEEE 802.1aq (Shortest Path Bridging) and much of the IEEE 802.1d standard.

802.1q VLAN interfaces are represented as virtual sub-interfaces in VyOS. The term used for this is vif.

set interfaces pseudo-ethernet <interface> vif <vlan-id>

Create a new VLAN interface on interface <interface> using the VLAN number provided via <vlan-id>.

You can create multiple VLAN interfaces on a physical interface. The VLAN ID range is from 0 to 4094.

Note

Only 802.1Q-tagged packets are accepted on Ethernet vifs.

set interfaces pseudo-ethernet <interface> vif <vlan-id> address <address | dhcp | dhcpv6>

Configure interface <interface> with one or more interface addresses.

  • address can be specified multiple times as IPv4 and/or IPv6 address, e.g. 192.0.2.1/24 and/or 2001:db8::1/64
  • dhcp interface address is received by DHCP from a DHCP server on this segment.
  • dhcpv6 interface address is received by DHCPv6 from a DHCPv6 server on this segment.

Example:

set interfaces pseudo-ethernet peth0 vif 10 address 192.0.2.1/24
set interfaces pseudo-ethernet peth0 vif 10 address 2001:db8::1/64
set interfaces pseudo-ethernet peth0 vif 10 dhcp
set interfaces pseudo-ethernet peth0 vif 10 dhcpv6
set interfaces pseudo-ethernet <interface> vif <vlan-id> description <description>

Set a human readable, descriptive alias for this connection. Alias is used by e.g. the show interfaces command or SNMP based monitoring tools.

Example:

set interfaces pseudo-ethernet peth0 vif 10 description 'This is an awesome interface running on VyOS'
set interfaces pseudo-ethernet <interface> vif <vlan-id> disable

Disable given <interface>. It will be placed in administratively down (A/D) state.

Example:

set interfaces pseudo-ethernet peth0 vif 10 disable
set interfaces pseudo-ethernet <interface> vif <vlan-id> disable-link-detect

Use this command to direct an interface to not detect any physical state changes on a link, for example, when the cable is unplugged.

Default is to detects physical link state changes.

Example:

set interfaces pseudo-ethernet peth0 vif 10 disable-link-detect
set interfaces pseudo-ethernet <interface> vif <vlan-id> mac <xx:xx:xx:xx:xx:xx>

Configure user defined MAC address on given <interface>.

Example:

set interfaces pseudo-ethernet peth0 vif 10 mac '00:01:02:03:04:05'
set interfaces pseudo-ethernet <interface> vif <vlan-id> mtu <mtu>

Configure MTU on given <interface>. It is the size (in bytes) of the largest ethernet frame sent on this link.

Example:

set interfaces pseudo-ethernet peth0 vif 10 mtu 9000
set interfaces pseudo-ethernet <interface> vif <vlan-id> ipv6 address autoconf

SLAAC RFC 4862. IPv6 hosts can configure themselves automatically when connected to an IPv6 network using the Neighbor Discovery Protocol via ICMPv6 router discovery messages. When first connected to a network, a host sends a link-local router solicitation multicast request for its configuration parameters; routers respond to such a request with a router advertisement packet that contains Internet Layer configuration parameters.

Note

This method automatically disables IPv6 traffic forwarding on the interface in question.

Example:

set interfaces pseudo-ethernet peth0 vif 10 ipv6 address autoconf
set interfaces pseudo-ethernet <interface> vif <vlan-id> ipv6 address eui64 <prefix>

EUI-64 as specified in RFC 4291 allows a host to assign iteslf a unique 64-Bit IPv6 address.

set interfaces pseudo-ethernet peth0 vif 10 ipv6 address eui64 2001:db8:beef::/64
set interfaces pseudo-ethernet <interface> vif <vlan-id> vrf <vrf>

Place interface in given VRF instance.

See also

There is an entire chapter about how to configure a VRF, please check this for additional information.

Example:

set interfaces pseudo-ethernet peth0 vif 10 vrf red

DHCP(v6)

set interfaces pseudo-ethernet <interface> vif <vlan-id> dhcp-options client-id <description>

RFC 2131 states: The client MAY choose to explicitly provide the identifier through the ‘client identifier’ option. If the client supplies a ‘client identifier’, the client MUST use the same ‘client identifier’ in all subsequent messages, and the server MUST use that identifier to identify the client.

Example:

set interfaces pseudo-ethernet peth0 vif 10 dhcp-options client-id 'foo-bar'
set interfaces pseudo-ethernet <interface> vif <vlan-id> dhcp-options host-name <hostname>

Instead of sending the real system hostname to the DHCP server, overwrite the host-name with this given-value.

Example:

set interfaces pseudo-ethernet peth0 vif 10 dhcp-options host-name 'VyOS'
set interfaces pseudo-ethernet <interface> vif <vlan-id> dhcp-options vendor-class-id <vendor-id>

The vendor-class-id option can be used to request a specific class of vendor options from the server.

Example:

set interfaces pseudo-ethernet peth0 vif 10 dhcp-options vendor-class-id 'VyOS'
set interfaces pseudo-ethernet <interface> vif <vlan-id> dhcp-options no-default-route

Only request an address from the DHCP server but do not request a default gateway.

Example:

set interfaces pseudo-ethernet peth0 vif 10 dhcp-options no-default-route
set interfaces pseudo-ethernet <interface> vif <vlan-id> dhcpv6-options parameters-only

This statement specifies dhcp6c to only exchange informational configuration parameters with servers. A list of DNS server addresses is an example of such parameters. This statement is useful when the client does not need stateful configuration parameters such as IPv6 addresses or prefixes.

set interfaces pseudo-ethernet peth0 vif 10 dhcpv6-options parameters-only
set interfaces pseudo-ethernet <interface> vif <vlan-id> dhcpv6-options rapid-commit

When rapid-commit is specified, dhcp6c will include a rapid-commit option in solicit messages and wait for an immediate reply instead of advertisements.

set interfaces pseudo-ethernet peth0 vif 10 dhcpv6-options rapid-commit
set interfaces pseudo-ethernet <interface> vif <vlan-id> dhcpv6-options temporary

Request only a temporary address and not form an IA_NA (Identity Association for Non-temporary Addresses) partnership.

set interfaces pseudo-ethernet peth0 vif 10 dhcpv6-options temporary

DHCPv6 Prefix Delegation (PD)

VyOS 1.3 (equuleus) supports DHCPv6-PD (RFC 3633). DHCPv6 Prefix Delegation is supported by most ISPs who provide native IPv6 for consumers on fixed networks.

set interfaces pseudo-ethernet <interface> vif <vlan-id> None None dhcpv6-option pd <id> length <length>

Some ISPs by default only delegate a /64 prefix. To request for a specific prefix size use this option to request for a bigger delegation for this pd <id>. This value is in the range from 32 - 64 so you could request up to a /32 prefix (if your ISP allows this) down to a /64 delegation.

The default value corresponds to 64.

To request a /56 prefix from your ISP use:

set interfaces pseudo-ethernet peth0 vif 10 None None dhcpv6-options pd 0 length 56
set interfaces pseudo-ethernet <interface> vif <vlan-id> None None dhcpv6-option pd <id> interface <delegatee> address <address>

Specify the interface address used locally on the interfcae where the prefix has been delegated to. ID must be a decimal integer.

It will be combined with the delegated prefix and the sla-id to form a complete interface address. The default is to use the EUI-64 address of the interface.

Example: Delegate a /64 prefix to interface eth8 which will use a local address on this router of <prefix>::ffff, as the address 65534 will correspond to ffff in hexadecimal notation.

set interfaces pseudo-ethernet peth0 vif 10 None None dhcpv6-option pd 0 interface eth8 address 65534
set interfaces pseudo-ethernet <interface> vif <vlan-id> None None dhcpv6-option pd <id> interface <delegatee> sla-id <id>

Specify the identifier value of the site-level aggregator (SLA) on the interface. ID must be a decimal number greater then 0 which fits in the length of SLA IDs (see below).

Example: If ID is 1 and the client is delegated an IPv6 prefix 2001:db8:ffff::/48, dhcp6c will combine the two values into a single IPv6 prefix, 2001:db8:ffff:1::/64, and will configure the prefix on the specified interface.

set interfaces pseudo-ethernet peth0 vif 10 None None dhcpv6-option pd 0 interface eth8 sla-id 1