Gateway
If we are sending a packet that is not on the same network, it will be sent to this Gateway address. Which is aptly named as being a Gateway to another network.
Genmask
This is the subnet mask, used to figure out what IP addresses match what destination.
Flags
UG - Network is Up and is a Gateway
U - Network is Up
Iface
This is the interface that our packet will be going out of, eth0 usually stands for the first Ethernet device on your system.
add a new route :
$ sudo route add -net ip_address/cidr gw ip_addresss
$ ip route add ip_address via ip_address
delete any route :
$ sudo route del -net 192.168.2.1/23
$ ip route delete 192.168.2.1/23
network config command:
network config command :
$ ifconfig
$ ipconfig
$ ifconfig -a [to see more details]
To create an interface and bring it up:
$ ifconfig eth0 192.168.2.1 netmask 255.255.255.0 up
To bring up or down an interface:
$ ifup eth0
$ ifdown eth0
To show interface information for all interfaces:
$ ip link show
To show the statistics of an interface:
$ ip -s link show eth0
To show ip addresses allocated to interfaces:
$ ip address show
To bring interfaces up and down:
$ ip link set eth0 up
$ ip link set eth0 down
To add an IP address to an interface:
$ ip address add 192.168.1.1/24 dev eth0
To obtain a fresh IP:
$ sudo dhclient
network manager command :
There are also command-line tools to interact with NetworkManager:
$ nm-tool
The nmcli command allows you to control and modify NetworkManage:
$ nmcli
we lookup a MAC address with ARP command:
$ arp
You can also view your arp cache via the ip command::
The traceroute command is used to see how packets are getting routed. It works by sending packets with increasing TTL values, starting with 1:
$ traceroute hostName or Ip_address or google.com
An extremely useful tool to get detailed information about your network is netstat. Netstat displays various network related information such network connections, routing tables, information about network interfaces and more:
$ netstat
$ netstat -at
utility to debug TCP/UDP sockets:
$ nc
we can be used to test remote connectivity on ports by using telnet command:
$ telnet
mtr is a mix of ping and traceroute. It also provides additional information like intermediate hosts and responsiveness:
$ mtr
here all DNS related linux command:
The /etc/hosts file contains mappings of some hostnames to IP addresses:
$ cat /etc/hosts
The "name server lookup" tool is used to query name servers to find information about resource records:
$ nslookup DNSname or ip_address
Dig (domain information groper) is a powerful tool for getting information about DNS name servers:
$ dig DNSname or ip_address
Top comments (0)
Subscribe
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)