Interface

Introduction

A network interface handles configuration of the network layer in a computer network. It can be a representation of a hardware unit but it also be a pure software construction in case of a SSL interface or a loopback interface. It typically has a network address.

Overview

In its simplest case a interface is a higher layer representation of a network port in a 1-1 mapping. A more complex example is a VLAN interface that can contain several network ports. It handles the network layer which means it typically has a network address such as an IPV4 address. It also resolves mapping between network addresses and MAC addresses through ARP functionality.

For the image below two hosts are connected via ports eth1 on each unit. Host-1 have configured interface vlan1 with address 192.168.0.10/24 and Host-2 have configured vlan2 with address 192.168.0.20/24.

  Host-1                                          Host-2
 .-------.                                       .-------.
 |       |                                       |       |
 |       |                                       |       |
 |   1   |vlan1                             vlan2|   1   |
 '---+---'                                       '---+---'
     |.10                192.168.0.0/24           .20|
     +-----------------------------------------------+

Configuration

Configuration of network interfaces is done in the iface context. Example of how to configure interface vlan1:

example:/#> configure
example:/config/#> iface vlan1
example:/config/iface-vlan1/#>

Syntax

[no|show] inet static [IP]/[LEN]|dhcp|ipcp|ssl|link-local|ttdp

This setting controls the handling of network addresses. It can be set and/or acquired in several ways.

Enters a sub-configuration context for any inet specific settings.

no
No network address will be set
static [IP]/[LEN]
Configure a static [IP] address with network mask with length [LEN]
dhcp
Acquire a network address through the DHCP protocol
ipcp
Acquire a network address through the IPCP protocol (PPP)
ssl
Acquire a network address through the SSL protocol
link-local
Acquire a network address through the link-local protocol
ttdp
Acquire a network address through the TTDP protocol
[no] enable

This setting controls if the interface is enabled or disabled. If the interface is disabled the network link(s) will go down and no network activity is possible.

no
Disable interface
[no] shutdown

Shutdown the interface, same as “no up”

no
Enable interface
[no] mac [MAC]

Change or restore MAC address of interface.

no
Use default MAC address
[no] mtu [68-1500]

Set maximum transfer unit, MTU, of interface.

no
Use default MTU size
[no] redirect

Enable sending of ICMP redirect messages.

no
Disable sending of ICMP redirect messages
[no] proxy-arp

Control Proxy ARP on this interface.

no
Default disable proxy ARP on this interface
[no] arp-notify

Control gratuitous ARP on link up and address change.

no
Default disable gratuitous ARP on this interface
[no] arp-accept

Allow receiving gratuitous ARP on this interface.

no
Default disable receiving gratuitous ARP on this interface
[no] name

This setting controls the interface name.

no
Default name used for this interface
[no] distance [1-255] [trigger <ID>]

Administrative distance for routes learned on this interface.

Static routes learned dynamically, e.g. via DHCP, will be installed in the routing table with this administrative distance.

Possible values are 1-255, where 1 is the best and 255 is infinity, it will be visible in the routing table but will never be activated.

Use the form ‘no distance’ to reset the value to its default value, 16. Use ‘distance 255’ to prevent routes from ever being activated.

A trigger ID may be set, e.g., for monitoring an upstream network with a ping trigger, and dynamically adjusting the default route to infinite distance. Effectively switching to another upstream interface not only on link loss.

no
Use default distance for this interface (16)
show

Show the summary for the configuration of the interface, an example is shown below.

Name          : vlan1
Admin Mode    : Up
MAC Address   : AUTO
IP Addresses  :
  Inet link-local
  Inet static
    192.168.2.10/24
MTU           : AUTO (1500)
ICMP Redirect : Sending
Proxy ARP     : Disabled
ARP Notify    : Enabled
ARP Accept    : Enabled
Distance      : 1

Inet DHCP Configuration

DHCP client configuration is performed in a sub-context under the interface configuration:

example:/config/iface-vlan1/#> inet dhcp
example:/config/iface-vlan1/inet-dhcp/#>
[no] clientid <hex|string> <STRING>

Configure the Client ID that is sent in DHCP requests.

Default: Use mac address.

no
Remove the configured client-id and use the default value.
hex
Indicates that the subsequent value is provided in hexadecimal form. The following syntax forms are valid: 0x1a2b, 1a:2b, 1a2b.
string
Indicates that the subsequent value is provided in string format.
[no] arping

Enable ARP-ping option in DHCP client.

no
Disable ARP-ping option in DHCP client.

Default: Enabled

[no] option <OPT> [<OPT>...]

Configure the DHCP Parameter Request List (DHCP option 55) that the client provides in its communication with the server.

The system supports the following options to be included in the DHCP Parameter Request List:

Option Number Description Requested by Default
1 Subnet Yes
3 Router Yes
6 DNS Server Yes
7 Log Server Yes
12 Hostname Yes
15 Domain Yes
42 NTP Server Yes
66 TFTP Server -
67 Bootfile -
121 Classless Route Yes
no
Use no option to reset the option request to the default options. Use no option OPT to not request that specific option.
OPT
DHCP option number.

Examples

The factory configuration for a standard interface will be configured to acquire network address through DHCP and link-local address protocols. For the example below, we will configure the two host with static network addresses and link-local addresses also.

Use case with static address

Two network units are connected via a network cable on port 1 on both hosts. Per default when a DHCP server isn’t present on the network the hosts will only acquire a link link address in the 169.254.0.0/16 range. In this case we want to set fixed addresses on both host in the 192.168.0.0/24 range. We’ll also use link local addresses on both hosts.

  Host-1                                          Host-2
 .-------.                                       .-------.
 |       |                                       |       |
 |       |                                       |       |
 |   1   |vlan1                             vlan1|   1   |
 '---+---'                                       '---+---'
     |.10                192.168.0.0/24           .20|
     +-----------------------------------------------+
Configuration for Host-1
Host-1:/#> configure
Host-1:/config/#> iface vlan1
Host-1:/config/iface-vlan1/#> inet static 192.168.2.10/24
Host-1:/config/iface-vlan1/inet-static-192.168.2.10/#> exit
Host-1:/config/iface-vlan1/#> inet link-local
Host-1:/config/iface-vlan1/inet-link-local#> leave
Configuration for Host-2
Host-2:/#> configure
Host-2:/config/#> iface vlan1
Host-2:/config/iface-vlan1/#> inet static 192.168.2.20/24
Host-2:/config/iface-vlan1/inet-static-192.168.2.20/#> exit
Host-2:/config/iface-vlan1/#> inet link-local
Host-2:/config/iface-vlan1/inet-link-local#> leave

Use case in DHCP Client mode

Two network units are connected via a network cable on port 1 on both hosts. The Host-2 runs a DHCP server with subnet range 192.168.1.0. The DHCP-Server has in this case an address pool in the range of 192.168.1.100 and 192.168.1.199. The Host-1 is configured to use inet dhcp on vlan1. We’ll also use link local address.

  Host-1                                          Host-2
 .-------.                                       .-------.
 | DHCP  |                                       | DHCP  |
 | Client|                                       | Server|
 |   1   |vlan1                             vlan1|   1   |
 '---+---'                                       '---+---'
     | dhcp .100                192.168.1.0/24     .1|
     +-----------------------------------------------+
                                pool 192.168.1.100-199
Configuration for Host-1
Host-1:/#> configure
Host-1:/config/#> iface vlan1
Host-1:/config/iface-vlan1/#> inet dhcp
Host-1:/config/iface-vlan1/inet-dhcp/#> exit
Host-1:/config/iface-vlan1/#> inet link-local
Host-1:/config/iface-vlan1/inet-link-local#> leave
Configuration for Host-2
example:/#> configure
example:/config/#> dhcp-server
example:/config/dhcp-server/#> subnet 192.168.1.0/24
Created new DHCP server for subnet 192.168.1.0.
example:/config/dhcp-server/subnet-192.168.1.0/#>
example:/config/dhcp-server/subnet-192.168.1.0/#>pool 192.168.1.50   192.168.1.99
example:/config/dhcp-server/subnet-192.168.1.0/#>leave
for more information see * DHCP-Server/Configuration

Status Overview

In order to verify an interface’s setting the ‘show’ command can be used:

Host-1:/#> show iface vlan1
Name         : vlan1
Admin. State : Up
Oper. Status : UP
MAC Address  : 52:54:00:12:34:56
IP Addresses : 192.168.2.10/24    (static)
               169.254.81.131/16  (link-local)
MTU          : 1500
Statistics   :
               RX: Packets    Bytes        Errors CsumErrs OutOfSeq Mcasts
                   57         4621         0      0        0        15
               TX: Packets    Bytes        Errors DeadLoop NoRoute  NoBufs
                   164        29003        0      0        0        0

This show that the interface vlan1 on Host-1 is up. It has two network addresses, 192.168.2.10/24 which has been configured as static and also network address 169.254.81.131/16 which has been resolved through link-local addressing.