Linux Commands for Networking Configuration And Troubleshooting

Exploring InterfaceThrough Ifconfig

 

Note

    On Modern Linux Systems, The IP command has been replaced with ifconfig.

 

if-config stands for "interface configuration". It is used to configure or  configuration of the networking setting of your system. if-config is used to make a interface accessible to the kernel networking layer.Common use of ifconfig include setting the IP address and netmask of a network interface and disabling or enabling an interface.


Syntax :

            ifconfig [...OPTIONS] [INTERFACE]

Tags
Description
interface
The name of the interface.
hw class address
Set the Hardware address of this interface .If the device driver support this operation. The keyword must be followed by the name of the hardware and the printable ASCII equivalent  of the hardware address.
[-]allmulti
This option is used to enable/disable all-multicast mode for an interface. If it is selected all-multicast packets will be received by the interface.
[-]broadcast
[addr]
 When Someone give “broadcast” option by the address argument, will set broadcast address to an interface.
down
This Flag forced the driver of the interface to be shutdown.
address
The IP address to be assigned to the interface.
[-]pointopoint [addr]
This argument enables the point-to-point mode of an interface. Meaning that it is a direct link between two machines with nobody else listening on it.
netmask addr
This argument will give IP network mask of the interface. 
[-]arp
This argument gives you information about the mapping cache, an allows you to manipulate it in various ways.
[-]promisc
Enable or disable the promiscuous mode of the interface. If selected, all packets on the network will be received by the interface.
metric N
This parameter sets the interface metric. It is not available under GNU/Linux.
 mtu N
This parameter sets the Maximum Transfer Unit (MTU) of an interface.
dstaddr addr
This argument will set the remote IP address for an point-to-point link (such as PPP). This keyword is no longer used , instead of this pointtopoint keyword is used.
add addr/prefixlen
This argument will add an IPv6 to an interface.
del addr/prefixlen
This argument will remove an IPv6 address of the interface.
tunnel
::aa.bb.cc.
Create a new SIT (IPv6-in-IPv4) device, tunnelling to the given destination.
irq addr
Set the interrupt line used by this device. Not all devices can dynamically change their IRQ setting.
io_addr addr
Set the start address in I/O space for this device..
mem_start addr
TSet the start address for shared memory used by this device. Only a few devices need this..
multicast
This will set the multicast Flag on the interface. This should not normally be needed as the drivers set the flag correctly themselves.
txqueuelen length
Set the length of the transmit queue of the device. It is useful to set this to small values for slower devices with a high latency (modem links, ISDN) to prevent fast bulk transfers from disturbing interactive traffic like telnet too much

In Order to check the Usage of the ifconfig command type in the terminal
 

    ifconfig --help

 

In order to check the detail description about ifconfig type 

    man ifconfig

Examples:


Running the ifconfig command without any argument:







Entering ifconfig at the terminal without any argument  will provide a fairly complete description of all active network interface.

Here eth0, wlan0 and l0 are active interface of the network on the internet.



Eth0

     eth0 is simple for ethernet connection 

here eth(0) is zero 

lo

    lo is basically your localhost

wlan0

    wlan0 is basically the wireless connection

 

 

To Check the Interfaces on your System

    ifconfig -a

    it will show all the interfaces on your system. There's possibility that there        may be some inactive interfaces on your system.

 

 

In order to check for individual interface config,

     ifconfig eth0( or your interface )

 

Inactive Interface:

    ifconfig also provides as the facility to activate or de-activate the interfaces     of network card. By default interface is inactive on our system. Suppose You     are sitting in your hostel room and you are connected through wlan0. Your        friend came to and ask for your laptop. You cannot deny him but here's a fun     trick you can the following command then watch the whole fucking            drama.But for that you mut have Superuser permision. 

As your are connected through wireless and your card interface is wlan0 or may be other :

    sudo ifconfig wlan0 down

    Your packet transmission will be pause because just now you gave            permission to down the wlan0 interface. The internet connection will be        showing but trasnmision will not work

So In order to up the interface use the following command:

    sudo ifconfig wlan0 up


Configure IP Address

    Your can also Specify Statics IP address To Your Card:

     sudo ifconfig wlan0 (ip you want to assign)

     sudo ifconfig eth0 (ip you want to assign



I will write more about ifconfig as It's my first article So I don't Understand the sequence. Remember In Your Happines


Stay Strong.

Comments

Popular posts from this blog

Linux Commands for Networking Configuration And Troubleshooting Part 2 👾