YouTip LogoYouTip

Linux Comm Ip

Linux ip Command | \\n\\n[![Image 1: Linux Command Encyclopaedia](#) Linux Command Encyclopaedia](#)\\n\\nThe Linux ip command is similar to the (#) command, but is more powerful than ifconfig. Its main function is to display or set network devices.\\n\\nThe ip command is an enhanced network configuration tool for Linux, used to replace the ifconfig command.\\n\\n### Syntax\\n\\nip OBJECT { COMMAND | help }\\n\\nOBJECT is a common object, which can have the following values:\\n\\n OBJECT={ link | addr | addrlabel | route | rule | neigh | ntable | tunnel | maddr | mroute | mrule | monitor | xfrm | token }\\n\\nThe meanings of common OBJECT values are as follows:\\n\\n* link: network device\\n* address: protocol (IP or IPv6) address on the device\\n* addrlabel: label configuration for protocol address selection\\n* route: routing table entry\\n* rule: rules in the routing policy database\\n\\nOPTIONS is a common option, which can have the following values:\\n\\nOPTIONS={ -V | -s | -d | -r | -h | -iec | -f { inet | inet6 | ipx | dnet | link } | -o | -t | -b | -rc }\\n\\nThe meanings of common OPTIONS values are as follows:\\n\\n* -V: display the version information of the command;\\n* -s: output more detailed information;\\n* -f: force using the specified protocol family;\\n* -4: specify that the network layer protocol is IPv4;\\n* -6: specify that the network layer protocol is IPv6;\\n* -0: output each record on a single line, even if the content is long and would normally wrap;\\n* -r: when displaying hosts, use the host domain name instead of IP addresses.\\n* help: help information for the command.\\n\\n### Examples\\n\\nip link show # Display Network Interface Information ip link set eth0 up # Enable Network Card ip link set eth0 down # Disable Network Card ip link set eth0 promisc on # Enable Network Card Promiscuous Mode ip link set eth0 promisc offi # Disable Network Card Promiscuous Mode ip link set eth0 txqueuelen 1200 # Set Network Card Queue Length ip link set eth0 mtu 1400 # Set Network Card Maximum Transmission Unit ip addr show # Display Network Card IP Information ip addr add 192.168.0.1/24 dev eth0 # Set eth0 Network Card IP Address 192.168.0.1 ip addr del 192.168.0.1/24 dev eth0 # Delete eth0 Network Card IP Address ip route show # Display System Routes ip route add default via 192.168.1.254 # Set System Default Route ip route list # View Route Information ip route add 192.168.4.0/24 via 192.168.0.254 dev eth0 # Set 192.168.4.0Network Segment Gateway is 192.168.0.254,Route Data Through eth0 Interface ip route add default via 192.168.0.254 dev eth0 # Set Default Gateway to 192.168.0.254 ip route del 192.168.4.0/24 # Delete 192.168.4.0Network Segment Gateway ip route del default # Delete Default Route ip route delete 192.168.1.0/24 dev eth0 # Delete Route\\n\\nDisplay the running status of network devices using the ip command:\\n\\n[root@localhost ~]# ip link list 1: lo: mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:002: eth0: mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:16:3e:00:1e:51 brd ff:ff:ff:ff:ff:ff 3: eth1: mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:16:3e:00:1e:52 brd ff:ff:ff:ff:ff:ff\\n\\nDisplay more detailed device information:\\n\\n[root@localhost ~]# ip -s link list 1: lo: mtu 16436 qdisc noqueue link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 RX: bytes packets errors dropped overrun mcast 5082831 56145 0 0 0 0 TX: bytes packets errors dropped carrier collsns 5082831 56145 0 0 0 0 2: eth0: mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:16:3e:00:1e:51 brd ff:ff:ff:ff:ff:ff RX: bytes packets errors dropped overrun mcast 3641655380 62027099 0 0 0 0 TX: bytes packets errors dropped carrier collsns 6155236 89160 0 0 0 0 3: eth1: mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:16:3e:00:1e:52 brd ff:ff:ff:ff:ff:ff RX: bytes packets errors dropped overrun mcast 2562136822 488237847 0 0 0 0 TX: bytes packets errors dropped carrier collsns 3486617396 9691081 0 0 0 0\\n\\nDisplay the kernel routing table
← Java HashmapJava Linkedlist β†’