Successfully pass the free certification exam at IW Academy and become an Infinet Certified Engineer.
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 [poe | -poe] [media MediaType]] [vlan TAG [-]vlandev IFParent] [[-]qinq (0x88A8) | [-]qtun (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
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 ] |
WARNING When "ifconfig eth0 delete" command is executed the CES module (if connected) becomes inactive. Reboot the device to activate CES again. |
[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. |
[poe | -poe] | Enables/disables support of POE at the interface. NOTE The option is available for the platform H11 only. |
[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.
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:
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).
|
clearstat | Resets a statistic of the network interface. |
destroy | Removes the virtual interface configuration. |
Examples
Display the statistic for the network interface "eth0". ifconfig eth0 eth0: flags=8103<UP,BROADCAST,PROMISC,MULTICAST> mtu 1500 inet 10.10.10.14 netmask 0xffffff00 broadcast 10.10.10.255 ether 00:04:35:03:f7:dd Info: "TEST TEXT" Physical link is UP, 100 Mbps Full-duplex, Auto PHY chip: Texas Instruments TLK10x ID: a2102000 +--------------------------------+------+-----+ | 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 | +--------------------------------+------+-----+ eth0: administrative status UP +--------------------------------+-----------------------------------+ | Receive statistics | Transmit statistics | +--------------------------------+-----------------------------------+ | Packets 151119 | Packets 28157 | | Bytes 28869191 | Bytes 11833627 | | Load (kbps) 22 | Load (kbps) 10 | | Load (pps) 14 | Load (pps) 6 | | Frame size (bytes) 196 | Frame size (bytes) 208 | +--------------------------------+-----------------------------------+ | CRC errors 0 | Carrier lost 0 | | Pause packets 0 | Excessive deferrals 0 | | Overruns 0 | Late collisions 0 | | Runts 0 | Multiple collisions 0 | | Short packets 0 | Single collisions 0 | | Alignment errors 0 | Lost in MAC frames 0 | | Long packets 0 | Excessive collision 0 | | Out of range 0 | Queue overflow 0 | | In range errors 0 | | | Descriptor 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 |