Announcement

Collapse
No announcement yet.

Useful Network commands in Linux

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Useful Network commands in Linux

    Useful Network commands
    route

    This command displays/change the routing table information.
    Code:
    $ route -n
    Displays system routing information

    Code:
    $ route add default gw 192.168.10.1
    Sets the system default gateway to 192.168.10.1
    ifconfig

    With this command the network interfaces can be configured overwriting the values on ifcfg-* files.
    Code:
    $ ifconfig
    Shows the network configuration of all configured network interfaces.

    Code:
    $ ifconfig eth0 192.168.10.6
    It assigns the ip 192.168.10.6 to the network interface eth0
    Code:
    $ ifconfig eth0:1 192.168.10.61
    It creates a virtual network interface eth0:1 from eth0 with the ip 192.168.10.61.
    Code:
    $ ifconfig eth0 up/down
    Activates/deactivates eth0 network interface
    dhclient

    This command is a dhcp-client that queries dhcp network configuration for the network interface to any active dhcp server.

    Code:
    $ dhclient eth0
    Configures eth0 with the dhcp configuration retrieved.
    system-config-network

    This command launches a graphical application that configures the network interfaces, including wireless interfaces.
    arp

    The arp command manages the relation between IP address and MAC address.
    Code:
    $ arp -a
    ? (192.168.10.223) at 00:0c:29:4b:ce:ed [ether] on eth0
    ? (192.168.10.6) at 00:0c:29:21:f7:7f [ether] on eth0
    Shows all arp entries cached by the system

    Code:
    $ arp -d hostname
    Removes hostname arp entry

    Code:
    $ arp -s hostname MAC
    Adds hostname arp entry with mac MAC
    ethtool

    Display/changes the network card settings.
    Code:
    $ ethtool eth0
    Settings for eth0:
    Current message level: 0x00000007 (7)
    Link detected: yes
    This commands verifies that there is a network wire plugged on eth0 network card.
    Last edited by kuldeep; 02-22-2015, 01:04 AM.
Working...
X