⁣⁣Ifconfig command (interfaces configuration)

Description

The "ifconfig" command allows to manage network interfaces configuration.

Syntax:

usage:
   ifconfig IFNAME
   [IP/MASK] [delete | -alias] [ up ] [ down ]
   [info "TEXT up to 72 chars"]
   [mtu N] - IPv4 datagram size
   [media MediaType]]
   [vlan TAG [-]parent IFNAME] [[-]dot1ad (0x88A8) | [-]dot1q (0x8100) | [-]dot1ah]
   clearstat
   destroy
   ifconfig -a

   MediaType: 
	auto
	10BaseT-halfduplex 	10BaseT-halfduplex-manual
	10BaseT-fullduplex 	10BaseT-fullduplex-manual
	100BaseTX-halfduplex 	100BaseTX-halfduplex-manual
	100BaseTX-fullduplex 	100BaseTX-fullduplex-manual
	1000BaseTX-fullduplex 	1000BaseTX-fullduplex-manual

Parameters

Parameter
Description

-a

Displays the configuration of all device network interfaces.

IFNAME

Specifies the name of an interface (to see all the unit’s interface names, the "ifconfig -a" or "netstat -i" commands may be executed). If no extra parameters are specified displays configuration and statistics of the interface.

[IP/MASK] [delete | -alias] [ up ] [ down ]

  • "IP/MASK" – the IP-address assigned to the interface and mask. Sets prefix length /32 (255.255.255.255) if mask value is not specified.

  • "delete" – removes the IP-address from the interface. "delete" and "-alias" parameters are possible to use without specifying an IP-address, in this case the primary IP-address will be deleted.

  • "alias" – indicates that IP-address should be added as additional. Each new IP-address assigned to an interface (except the first, called primary) is considered as an alias address. "-alias" allows to remove an IP-address from an interface, is applicable to any IP-address so all IP-addresses assigned to the interface are considered as equivalent aliases. If the first (primary) address is removed, the next (in the order of their assignment) becomes primary.

  • "up/down" – enables/disables the interface. System limitations:

    • "lo0" and "null0" interfaces cannot be set to the "down" state;

    • radio interfaces states are not saved in the configuration (after rebooting all radio interfaces of the unit are in the "up" state).

[info "TEXT up to 72 chars"]

Allows to add a text note of up to 72 characters to an interface configuration.

[mtu N] - IPv4 datagram size

Sets the desirable MTU (Maximum Transfer Unit) size of the packet for the interface (in bytes). The allowed range is from 72 to 1580. Default value is 1500. Usually the value of this parameter does not need to be changed, but in some cases decreasing the MTU value facilitates improving the work condition for a client with very low signal level. In addition, it can be used to vary parameters of the tunnel interfaces.

[media MediaType]

Allows to specify physical Ethernet interface type, by default is "auto". Allowed MediaType values (model dependent).

[vlan TAG [-]vlandev IFParent] [[-]qinq (0x88A8) | [-]qtun (0x8100)| [-]dot1ah]

Sets the configuration of "vlanX" interface (VLAN IEEE 802.1q). Both additional parameters of "vlanX" interface ("vlan" и "vlandev") should be entered in one line.

  • "vlan" – sets VLAN tag for the current interface (1-4094).

  • "vlandev" – creates a connection with a physical interface which serves the media – "eth0" in this case. The "-vlandev" parameter remove this connection. For the normal "vlanX" interface functioning, a physical interface "eth0" should be in the "up" state.

IEEE 802.1Q-in-Q support can be enabled on the unit. It allows adding an outer VLAN ID tag to IEEE 802.1Q tagged traffic forming so called "double-tagged" frames, thus, making it possible to encapsulate multiple VLANs (inner, CVLAN) within one single outer SVLAN. To configure IEEE 802.1Q-in-Q VLAN tagging on the unit the following options are used:

  • qinq (0x88A8)” – complies to SVLAN with EtherType 0x88A8.

  • "qtun (0x8100)" – complies to SVLAN with EtherType 0x8100 (by default on Cisco switches).

When this option is enabled the unit’s interface terminates the specified outer VLAN ID tag of the incoming IEEE 802.1Q doubled-tagged traffic and assigns the outer tag to the outgoing tagged traffic (IEEE 802.1ad).

  • "[-]dot1ah"enables/disables support on IEEE 802.1ah standart. Allows to configure the Provider Backbone Bridges (PBB), it introduces a hierarchical network architecture with associated new frame formats. PBB architecture aggregates Provider Bridged networks (created by 802.1ad). The IEEE 802.1ah frame format encapsulates customer Ethernet frames it allows to hide customer's MAC-addresses, add also 24-bit service identifier (I-SID) to increase number of VLANs which can be used in backbone area. On both sides of the channel must be activated bridges with same names. For the PBB bridge management, the "pbbN" virtual interface and the "pbb N parent IF isid ID" command are used, where:

    • "N" – virtual interface number from 0 to 15;

    • "IF" – interface used as a parent;

    • "ID" – 24-bit service identifier I-SID.

clearstat

Resets a statistic of the network interface.

destroy

Removes the virtual interface configuration.

Examples

Display the statistic for the network interface "eth0".

Evo_Slave1#console>ifc eth0
eth0:   flags=8103<UP,BROADCAST,PROMISC,MULTICAST>
        inet 10.10.20.1/24 broadcast 10.10.20.255
        ether a0:22:52:05:35:74 

	Physical link is UP, 1000 Mbps Full-duplex, Auto
	PHY chip: Broadcom BCM5301x ID: 8760600d
	+--------------------------------+------+-----+
	|                 Supported modes| Self |Peer |
	+--------------------------------+------+-----+
	|                Auto-Negotiation| yes  | yes |
	|             10 Mbps Half-duplex| yes  | yes |
	|             10 Mbps Full-duplex| yes  | yes |
	|            100 Mbps Half-duplex| yes  | yes |
	|            100 Mbps Full-duplex| yes  | yes |
	|           1000 Mbps Half-duplex| yes  |  -  |
	|           1000 Mbps Full-duplex| yes  | yes |
	+--------------------------------+------+-----+

	eth0: administrative status UP
	+--------------------------------+-----------------------------------+
	|       Receive statistics       |        Transmit statistics        |
	+--------------------------------+-----------------------------------+
	| Packets            252535      | Packets               13236       |
	| Bytes              30320783    | Bytes                 3548410     |
	| Load (kbps)        1           | Load (kbps)           0           |
	| Load (pps)         1           | Load (pps)            0           |
	| Frame size (bytes) 125         | Frame size (bytes)    0           |
	+--------------------------------+-----------------------------------+
	| Length errors      0           | Collisions            0           |
	| CRC errors         0           |                                   |
	| Frame errors       0           |                                   |
	| Missed errors      0           |                                   |
	+--------------------------------+-----------------------------------+

IP-addresses can be added on the interface in different ways.

ifconfig eth0 192.168.1.1/26
ifconfig eth0 192.168.1.1:255.255.255.192
ifconfig eth0 192.168.1.1

Set "193.124.189.1/27" as a primary IP-address and "10.0.0.1" as an additional for the interface "eth0". Also swich the interface to the "up" state.

ifconfig eth0 193.124.189.1/27 up
ifconfig eth0 10.0.0.1 alias

Create the "vlan1" interface with tag 5 and connect it to the "eth0" interface.

Break the connection between "vlan1" and "eth0".

ifconfig vlan1 up
ifconfig vlan1 vlan 5 vlandev eth0
ifconfig vlan1 -vlandev eth0

Create the "vlan2" interface with tag 2 and connect it to the "eth0" interface. Set 1500 MTU value and enable support of qinq option.

ifc vlan2 qinq mtu 1500 up
ifc vlan2 vlan 2 vlandev eth0

Create a PBB bridge to transfer customer data through the provider's backbone network. Customer traffic will be encapsulated in VLAN 100 with I-SID 200.

ifconfig vlan100 vlan 100 vlandev eth0 dot1ah up
ifconfig pbb 1 up
pbb 1 parent vlan100 isid 200

Last updated

Astra Wireless Technology © 2024. All rights reserved. For more information about available models, sales and technical support, please proceed to https://astrawireless.net/