{"id":675,"date":"2020-10-15T21:18:00","date_gmt":"2020-10-15T13:18:00","guid":{"rendered":"https:\/\/www.cxybj.com\/?p=675"},"modified":"2020-10-15T21:18:01","modified_gmt":"2020-10-15T13:18:01","slug":"linux%e4%b8%8b%e5%8d%95%e7%bd%91%e5%8d%a1%e9%85%8d%e7%bd%ae%e5%a4%9aip%e5%85%b6%e5%ae%9e%e5%8f%af%e4%bb%a5%e8%bf%99%e6%a0%b7%e7%ae%80%e5%8d%95","status":"publish","type":"post","link":"https:\/\/www.cxybj.com\/?p=675","title":{"rendered":"Linux\u4e0b\u5355\u7f51\u5361\u914d\u7f6e\u591aIP\u5176\u5b9e\u53ef\u4ee5\u8fd9\u6837\u7b80\u5355"},"content":{"rendered":"<p>linux\u4e3a\u5355\u7f51\u5361\u914d\u7f6e\u591a\u4e2aIP\u5730\u5740\u65b9\u6cd5\uff0c\u4e24\u79cd\u65b9\u5f0f\uff0c<br \/>\n\u4e00\u79cd\u662f\u4f7f\u7528\u547d\u4ee4\u8fdb\u884c\u76f4\u63a5\u914d\u7f6e\uff0c<br \/>\n\u53e6\u5916\u4e00\u79cd\u5c31\u662f\u81ea\u5df1\u7f16\u5199\u914d\u7f6e\u6587\u4ef6\uff0c<br \/>\n<strong>1.\u4f7f\u7528\u547d\u4ee4\u8fdb\u884c\u914d\u7f6e<\/strong><br \/>\n\u8fd9\u5c31\u5f88\u7b80\u5355\u4e86\uff0c\u9996\u5148\u67e5\u770b\u4e00\u4e0b\u5f53\u524d\u673a\u5668\u7684IP\u5730\u5740\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<br \/>\n#<wbr>ifconfig<br \/>\n<wbr>eth0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Link encap:Ethernet&nbsp;&nbsp;HWaddr 00:19:D1:24:2A:EC<br \/>\ninet addr:192.168.1.55&nbsp;&nbsp;Bcast:192.168.3.255&nbsp;&nbsp;Mask:255.255.252.0<wbr><br \/>\ninet6 addr: fe80::219:d1ff:fe24:2aec\/64 Scope:Link<br \/>\nUP BROADCAST RUNNING MULTICAST&nbsp;&nbsp;MTU:1500&nbsp;&nbsp;Metric:1<br \/>\n\u6ce8\u610f\u770b\u5176\u4e2d\u7684\u7ea2\u8272\u90e8\u5206\uff0c\u53ef\u4ee5\u770b\u5230\u6211\u4eec\u672c\u673a\u7684IP\u5730\u5740\u4e3a1.55\uff0c\u90a3\u4e48\u6211\u4eec\u6765\u914d\u4e00\u4e2a1.56\uff08\u6ce8\u610f\u4e0d\u8981\u548c\u5c40\u57df\u7f51\u5185\u7684\u5730\u5740\u51b2\u7a81\u54e6\uff09\uff0c\u4f7f\u7528\u547d\u4ee4\u5982\u4e0b\uff1a<br \/>\n#<wbr>ifconfig eth0:0 192.168.1.56 netmask 255.255.252.0<br \/>\n<wbr>#<wbr>ifconfig<br \/>\n<wbr>eth0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Link encap:Ethernet&nbsp;&nbsp;HWaddr 00:19:D1:24:2A:EC<br \/>\ninet addr:192.168.1.55&nbsp;&nbsp;Bcast:192.168.3.255&nbsp;&nbsp;Mask:255.255.252.0<br \/>\ninet6 addr: fe80::219:d1ff:fe24:2aec\/64 Scope:Link<br \/>\nUP BROADCAST RUNNING MULTICAST&nbsp;&nbsp;MTU:1500&nbsp;&nbsp;Metric:1<br \/>\neth0:0&nbsp;&nbsp;&nbsp;&nbsp;Link encap:Ethernet&nbsp;&nbsp;HWaddr 00:19:D1:24:2A:EC<br \/>\ninet addr:192.168.1.56&nbsp;&nbsp;Bcast:192.168.3.255&nbsp;&nbsp;Mask:255.255.252.0<br \/>\nUP BROADCAST RUNNING MULTICAST&nbsp;&nbsp;MTU:1500&nbsp;&nbsp;Metric:1<br \/>\n#<wbr>ping 192.168.1.56<wbr><br \/>\nPING 192.168.1.56 (192.168.1.56) 56(84) bytes of data.<br \/>\n64 bytes from 192.168.1.56: icmp_seq=1 ttl=64 time=0.045 ms<br \/>\n64 bytes from 192.168.1.56: icmp_seq=2 ttl=64 time=0.045 ms<br \/>\n64 bytes from 192.168.1.56: icmp_seq=3 ttl=64 time=0.043 ms<br \/>\n#<wbr>ping 192.168.1.55<br \/>\n<wbr>PING 192.168.1.55 (192.168.1.55) 56(84) bytes of data.<br \/>\n64 bytes from 192.168.1.55: icmp_seq=1 ttl=64 time=0.030 ms<br \/>\n64 bytes from 192.168.1.55: icmp_seq=2 ttl=64 time=0.022 ms<br \/>\n64 bytes from 192.168.1.55: icmp_seq=3 ttl=64 time=0.022 ms<br \/>\n\u8fd9\u6837\u6211\u4eec\u5c31\u5f88\u65b9\u4fbf\u7684\u914d\u7f6e\u4e86\u53e6\u5916\u4e00\u4e2aIP\u5730\u57401.55\uff01<br \/>\n<strong>2.\u4f7f\u7528\u914d\u7f6e\u6587\u4ef6\u8fdb\u884c\u914d\u7f6e<\/strong><br \/>\n\u7f51\u5361IP\u914d\u7f6e\u7684\u6587\u4ef6\u5728\/etc\/sysconfig\/network-scripts\/\u4e0b\uff0c\u6587\u4ef6\u5206\u522b\u4e3aehtx\u6216ethx:x\uff0c\u6267\u884c\u547d\u4ee4\u5982\u4e0b\uff1a<br \/>\n#<wbr>cd \/etc\/sysconfig\/network-scripts\/<br \/>\n<wbr>#<wbr>cp ifcfg-eth0 ifcfg-eth0:1<wbr><br \/>\n\u8fd9\u6837\u6211\u4eec\u5c31\u7b80\u5355\u7684copy\u4e86\u4e00\u4efd\u5f53\u524d\u7f51\u7edc\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u7136\u540e\u6211\u4eec\u6253\u5f00\u8fd9\u4e2a\u590d\u5236\u540e\u7684\u6587\u4ef6\uff0c\u6539\u5176\u4e2d\u7684IP\u5730\u5740\u4e3a\u6211\u4eec\u60f3\u8981\u7684IP\u5730\u5740\uff0c\u5982192.168.1.57\u5373\u53ef\uff01<br \/>\n#<wbr>vi ifcfg-eth0:1<br \/>\n<wbr>DEVICE=eth0<br \/>\nBOOTPROTO=none<br \/>\nHWADDR=00:19:D1:24:2A:EC<br \/>\nONBOOT=yes<br \/>\nDHCP_HOSTNAME=zhongqg.localdomain<br \/>\nIPADDR=192.168.1.55<wbr><br \/>\nNETMASK=255.255.252.0<br \/>\nGATEWAY=192.168.0.1<br \/>\nTYPE=Ethernet<br \/>\nUSERCTL=no<br \/>\nIPV6INIT=no<br \/>\nPEERDNS=yes<br \/>\n\u7136\u540e\u6211\u4eec\u7b80\u5355\u7684\u4fee\u6539\u5176\u4e2d\u7684\u7ea2\u8272\u90e8\u5206\u4e3a\u6211\u4eec\u7684IP\u5730\u5740\u5373\u53ef\uff0c\u7136\u540e\u4fdd\u5b58\u9000\u51fa\u5e76\u542f\u52a8\u8be5\u914d\u7f6e\u6587\u4ef6\uff01<br \/>\n#<wbr>ifup eth0:1<wbr><br \/>\n\u8fd9\u6837\u6211\u4eec\u5c31\u914d\u7f6e\u597d\u4e86\uff0c\u770b\u6765linux\u914d\u7f6e\u591aIP\u5176\u5b9e\u4e5f\u662f\u86ee\u7b80\u5355\u7684\uff0c\u5475\u5475~~~~<\/p>\n","protected":false},"excerpt":{"rendered":"<p>linux\u4e3a\u5355\u7f51\u5361\u914d\u7f6e\u591a\u4e2aIP\u5730\u5740\u65b9\u6cd5\uff0c\u4e24\u79cd\u65b9\u5f0f\uff0c \u4e00\u79cd\u662f\u4f7f &hellip; <a href=\"https:\/\/www.cxybj.com\/?p=675\" class=\"more-link\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.cxybj.com\/index.php?rest_route=\/wp\/v2\/posts\/675"}],"collection":[{"href":"https:\/\/www.cxybj.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cxybj.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cxybj.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cxybj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=675"}],"version-history":[{"count":2,"href":"https:\/\/www.cxybj.com\/index.php?rest_route=\/wp\/v2\/posts\/675\/revisions"}],"predecessor-version":[{"id":677,"href":"https:\/\/www.cxybj.com\/index.php?rest_route=\/wp\/v2\/posts\/675\/revisions\/677"}],"wp:attachment":[{"href":"https:\/\/www.cxybj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=675"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cxybj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=675"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cxybj.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=675"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}