Linux network management commands notes

Network Status Check command (command requires the following three net-tools Kit)

  ifconfig see card basic information  inet for the ip address netmask subnet mask ether as MAC address lo card in exchange for the local address 127.0.0.1

  mii-tool to check the physical link card case

  route View Gateway   -n do not resolve the domain name (faster)

  Change the network card named eth0 (easy server-side batch processing) 

    1 Modify / etc / default / grub set GRUB_CMDLINE_LINUX_DEFAULT = "iosdevname = 0 net.ifname = 0"

    2 update grub grub-mkconfig -o /boot/grub/grub.cfg

    3 reboot reboot

 

Modify the network configuration

  ifconfig

    ifconfig <card> <ip address> [network <mask>] Review ip address card (also take the opportunity to modify the mask)

    ifup <card> enabled NIC ifdown <card> turn off the card (typically need not be provided)

  route

    route add default gw <gateway ip> to modify the default gateway

    route del default gw <gateway ip> delete the default gateway

    route add -host <ip1> gw < ip2> go ip1 walk gateway ip2

    route add -net <ip1> network <  ip2> gw <ip3> destined for the subnet mask for the network segment ip2 ip1 go ip3

 

Network Troubleshooting Commands

  ping monitor to a site is smooth ping www.baidu.com

  traceroute trace route to a site through

  mtr and traceroute similar to the more powerful

  nslookup domain name -> ip

  tenlet monitor port is smooth

  tcpdump trace tcp packets

    -i any arbitrary tcp package

    -n Do not resolve domain names

    Flights a host port specified host port specified (specify a host name and port and)

    -W file saved to a file file

  netstat displays more detailed information on the network connection

  ss and similar netstat

Guess you like

Origin www.cnblogs.com/kkcoolest/p/11717357.html