{"id":3957,"date":"2019-07-18T19:02:28","date_gmt":"2019-07-18T11:02:28","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=3957"},"modified":"2022-05-16T14:54:29","modified_gmt":"2022-05-16T06:54:29","slug":"ip","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/ip","title":{"rendered":"ip\u547d\u4ee4 – \u663e\u793a\u4e0e\u914d\u7f6e\u7f51\u5361\u53c2\u6570"},"content":{"rendered":"\n

ip\u547d\u4ee4\u7684\u529f\u80fd\u662f\u7528\u4e8e\u663e\u793a\u4e0e\u914d\u7f6e\u7f51\u5361\u53c2\u6570\u3002\u4f5c\u4e3aLinux\u7cfb\u7edf\u4e0b\u4e00\u6b3e\u597d\u7528\u7684\u7f51\u5361\u53c2\u6570\u914d\u7f6e\u5de5\u5177\uff0cip\u547d\u4ee4\u9664\u4e86\u5e38\u89c4\u64cd\u4f5c\u5916\uff0c\u8fd8\u53ef\u4ee5\u5bf9\u4e3b\u673a\u7684\u8def\u7531\u3001\u7f51\u7edc\u8bbe\u5907\u3001\u7b56\u7565\u8def\u7531\u4ee5\u53ca\u96a7\u9053\u4fe1\u606f\u8fdb\u884c\u67e5\u770b\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f<\/strong>\uff1aip [\u53c2\u6570]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570<\/strong>\uff1a<\/p>\n\n\n\n

-s<\/td>\u8f93\u51fa\u66f4\u8be6\u7ec6\u7684\u4fe1\u606f<\/td><\/tr>
-f<\/td>\u5f3a\u5236\u4f7f\u7528\u6307\u5b9a\u7684\u534f\u8bae\u65cf<\/td><\/tr>
-4<\/td>\u6307\u5b9a\u4f7f\u7528\u7684\u7f51\u7edc\u5c42\u534f\u8bae\u662fIPv4\u534f\u8bae<\/td><\/tr>
-6<\/td>\u6307\u5b9a\u4f7f\u7528\u7684\u7f51\u7edc\u5c42\u534f\u8bae\u662fIPv6\u534f\u8bae<\/td><\/tr>
-r<\/td>\u663e\u793a\u4e3b\u673a\u65f6\uff0c\u4e0d\u4f7f\u7528IP\u5730\u5740\uff0c\u800c\u4f7f\u7528\u4e3b\u673a\u7684\u57df\u540d<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u663e\u793a\u5f53\u524d\u7684\u7f51\u7edc\u8bbe\u5907\u8fd0\u884c\u72b6\u6001:<\/p>\n\n\n\n

[root@linuxcool ~]# ip link<\/strong>\n1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000\n    link\/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\n2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\n    link\/ether 00:0c:29:60:cd:ee brd ff:ff:ff:ff:ff:ff\n3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000\n    link\/ether 52:54:00:ad:1e:4d brd ff:ff:ff:ff:ff:ff\n4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN mode DEFAULT group default qlen 1000\n    link\/ether 52:54:00:ad:1e:4d brd ff:ff:ff:ff:ff:ff<\/pre>\n\n\n\n

\u663e\u793a\u5f53\u524d\u7684\u7f51\u7edc\u8bbe\u5907\u7684\u8be6\u7ec6\u8fd0\u884c\u72b6\u6001:<\/p>\n\n\n\n

[root@linuxcool ~]# ip -s link <\/strong>\n1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000\n    link\/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\n    RX: bytes  packets  errors  dropped overrun mcast   \n    0          0        0       0       0       0       \n    TX: bytes  packets  errors  dropped carrier collsns \n    0          0        0       0       0       0       \n2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000\n    link\/ether 00:0c:29:22:31:9c brd ff:ff:ff:ff:ff:ff\n    RX: bytes  packets  errors  dropped overrun mcast   \n    0          0        0       0       0       0       \n    TX: bytes  packets  errors  dropped carrier collsns \n    4186       36       0       0       0       0       \n3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000\n    link\/ether 52:54:00:8a:09:91 brd ff:ff:ff:ff:ff:ff\n    RX: bytes  packets  errors  dropped overrun mcast   \n    0          0        0       0       0       0       \n    TX: bytes  packets  errors  dropped carrier collsns \n    0          0        0       0       0       0       \n4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel master virbr0 state DOWN mode DEFAULT group default qlen 1000\n    link\/ether 52:54:00:8a:09:91 brd ff:ff:ff:ff:ff:ff\n    RX: bytes  packets  errors  dropped overrun mcast   \n    0          0        0       0       0       0       \n    TX: bytes  packets  errors  dropped carrier collsns \n    0          0        0       0       0       0       \n<\/pre>\n\n\n\n

\u663e\u793a\u5f53\u524d\u6838\u5fc3\u8def\u7531\u8868\u4fe1\u606f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ip route list<\/strong>\n192.168.10.0\/24 dev ens160 proto kernel scope link src 192.168.10.10 metric 100 \n192.168.122.0\/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown <\/pre>\n","protected":false},"excerpt":{"rendered":"

ip\u547d\u4ee4\u7684\u529f\u80fd\u662f\u7528\u4e8e\u663e\u793a\u4e0e\u914d\u7f6e\u7f51\u5361\u53c2\u6570\u3002\u4f5c\u4e3aLinux\u7cfb\u7edf\u4e0b\u4e00\u6b3e\u597d\u7528\u7684\u7f51\u5361\u53c2\u6570\u914d\u7f6e\u5de5\u5177\uff0cip\u547d\u4ee4\u9664\u4e86\u5e38\u89c4\u64cd\u4f5c\u5916 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/3957"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=3957"}],"version-history":[{"count":9,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/3957\/revisions"}],"predecessor-version":[{"id":9725,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/3957\/revisions\/9725"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=3957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=3957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=3957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}