Useful Network commands
route
This command displays/change the routing table information.
Displays system routing information
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.
Shows the network configuration of all configured network interfaces.
It assigns the ip 192.168.10.6 to the network interface eth0
It creates a virtual network interface eth0:1 from eth0 with the ip 192.168.10.61.
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.
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.
Shows all arp entries cached by the system
Removes hostname arp entry
Adds hostname arp entry with mac MAC
ethtool
Display/changes the network card settings.
This commands verifies that there is a network wire plugged on eth0 network card.
route
This command displays/change the routing table information.
Code:
$ route -n
Code:
$ route add default gw 192.168.10.1
ifconfig
With this command the network interfaces can be configured overwriting the values on ifcfg-* files.
Code:
$ ifconfig
Code:
$ ifconfig eth0 192.168.10.6
Code:
$ ifconfig eth0:1 192.168.10.61
Code:
$ ifconfig eth0 up/down
dhclient
This command is a dhcp-client that queries dhcp network configuration for the network interface to any active dhcp server.
Code:
$ dhclient eth0
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
Code:
$ arp -d hostname
Code:
$ arp -s hostname MAC
ethtool
Display/changes the network card settings.
Code:
$ ethtool eth0 Settings for eth0: Current message level: 0x00000007 (7) Link detected: yes