{"id":1872,"date":"2024-03-18T01:47:01","date_gmt":"2024-03-17T17:47:01","guid":{"rendered":"http:\/\/www.ccwifi.cc\/blogs\/?p=1872"},"modified":"2024-03-18T01:47:01","modified_gmt":"2024-03-17T17:47:01","slug":"%e5%a4%a7%e7%a5%9e%e6%95%99%e4%bd%a0%e5%a4%84%e7%90%86linux%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%bd%91%e5%8d%a1%e8%af%86%e5%88%ab%e5%a4%b1%e8%b4%a5%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.ccwifi.cc\/blogs\/2024\/03\/18\/%e5%a4%a7%e7%a5%9e%e6%95%99%e4%bd%a0%e5%a4%84%e7%90%86linux%e6%9c%8d%e5%8a%a1%e5%99%a8%e7%bd%91%e5%8d%a1%e8%af%86%e5%88%ab%e5%a4%b1%e8%b4%a5%e7%9a%84%e6%96%b9%e6%b3%95\/","title":{"rendered":"\u5927\u795e\u6559\u4f60\u5904\u7406Linux\u670d\u52a1\u5668\u7f51\u5361\u8bc6\u522b\u5931\u8d25\u7684\u65b9\u6cd5"},"content":{"rendered":"<div>\n<p>\u5728\u7ebfwifi\u8dd1\u5305 \u91d1\u521a\u5305\u8dd1\u5305 cap\u8dd1\u5305 hccapx ewsa\u5728\u7ebf \u5c31\u6765 <strong><a href=\"https:\/\/ccwifi.cc\" target=\"_blank\" rel=\"noopener\">\u63e1\u624b\u5305\u8dd1\u5305<\/a><\/strong><\/p>\n<p>\u5404\u4f4d\u597d \u53c8\u89c1\u9762\u4e86 \u6211\u662f\u66f9\u64cd \u4eca\u5929\u7ed9\u5927\u5bb6\u5e26\u6765\u4e00\u7bc7\u65b0\u7684\u6559\u7a0b<\/p>\n<p>\u5e0c\u671b\u5404\u4f4d\u7ec6\u5fc3\u5b66\u4e60 \u4f4e\u8c03\u7528\u7f51<\/p>\n<\/div>\n<pre>[root@kevin01 ~]# ifconfig -a bond0     Link encap:Ethernet  HWaddr 08:94:EF:5E:AE:72            inet addr:192.168.10.20  Bcast:192.168.10.255  Mask:255.255.255.0           inet6 addr: fe80::a94:efff:fe5e:ae72\/64 Scope:Link           UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1           RX packets:75582 errors:0 dropped:0 overruns:0 frame:0           TX packets:58537 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0           RX bytes:5890233 (5.6 MiB)  TX bytes:4390537 (4.1 MiB)   lo        Link encap:Local Loopback            inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1\/128 Scope:Host           UP LOOPBACK RUNNING  MTU:65536  Metric:1           RX packets:26 errors:0 dropped:0 overruns:0 frame:0           TX packets:26 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0           RX bytes:1983 (1.9 KiB)  TX bytes:1983 (1.9 KiB)   usb0      Link encap:Ethernet  HWaddr 0A:94:EF:5E:AE:79            BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)<\/pre>\n<p>1\uff09\u73b0\u8c61\u63cf\u8ff0\uff1a\u5728\u516c\u53f8\u7684IDC\u673a\u623f\u4e2d\uff0c\u4e00\u53f0\u7ebf\u4e0a\u670d\u52a1\u5668\u7684\u786c\u4ef6\u53d1\u51fa\u62a5\u8b66\u4fe1\u53f7\u3002\u7ecf\u8fc7\u6392\u67e5\uff0c\u53d1\u73b0\u670d\u52a1\u5668\u7684\u4e3b\u677f\u51fa\u73b0\u6545\u969c\u3002\u968f\u540e\uff0c\u6211\u4eec\u8054\u7cfb\u4e86\u5382\u5546\u8fdb\u884c\u4e3b\u677f\u66f4\u6362\u3002\u7136\u800c\uff0c\u5728\u66f4\u6362\u540e\u91cd\u65b0\u767b\u5f55\u670d\u52a1\u5668\u65f6\uff0c\u53d1\u73b0\u5c3d\u7ba1\u7f51\u5361\u7ed1\u5b9a\u548cIP\u4fe1\u606f\u90fd\u5b58\u5728\uff0c\u4f46\u662f\u65e0\u6cd5\u901a\u8fc7ping\u547d\u4ee4\u8fdb\u884c\u8fde\u63a5\u3002\u8fdb\u4e00\u6b65\u6392\u67e5\u540e\u53d1\u73b0\uff0c\u91cd\u542f\u7f51\u5361\u65f6\uff0c\u63d0\u793a\u4e4b\u524d\u7684eth0\u548ceth1\u7f51\u5361\u8bbe\u5907\u65e0\u6cd5\u88ab\u8bc6\u522b\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u4e3b\u677f\u66f4\u6362\u540e\uff0c\u4e4b\u524d\u7684\u7f51\u5361\u8bbe\u5907\u65e0\u6cd5\u88ab\u8bc6\u522b\u3002<\/p>\n<pre>[root@kevin ~]# cd \/etc\/sysconfig\/network-scripts\/ [root@kevin network-scripts]# ls ifcfg-bond0  ifcfg-lo     ifdown-ib    ifdown-ppp     ifup-aliases  ifup-ipv6   ifup-ppp       init.ipv6-global ifcfg-eth0   ifcfg-usb0   ifdown-ippp  ifdown-routes  ifup-bnep     ifup-isdn   ifup-routes    net.hotplug ifcfg-eth1   ifdown       ifdown-ipv6  ifdown-sit     ifup-eth      ifup-plip   ifup-sit       network-functions ifcfg-eth2   ifdown-bnep  ifdown-isdn  ifdown-tunnel  ifup-ib       ifup-plusb  ifup-tunnel    network-functions-ipv6 ifcfg-eth3   ifdown-eth   ifdown-post  ifup           ifup-ippp     ifup-post   ifup-wireless   [root@kevin ~]# \/etc\/init.d\/network restart ......<\/pre>\n<pre>[root@kevin ~]# ipdown eth0<\/pre>\n<pre># mv \/etc\/udev\/rules.d\/70-persistent-net.rules \/etc\/udev\/rules.d\/70-persistent-net.rules.bak20180307 # init 6 <\/pre>\n<p>\u4e4b\u524d\u7684\u7f51\u5361\u8bbe\u5907\u548c\u7ed1\u5b9a\u7684bond\u914d\u7f6e\u4fe1\u606f\u4ecd\u7136\u5b58\u5728\uff08\u7ed1\u5b9a\u7f51\u5361\u7684\u64cd\u4f5c\uff09\u3002\u62a5\u9519\u4fe1\u606f\u663e\u793a\u627e\u4e0d\u5230eth0\u548ceth1\u7f51\u5361\u3002\u62a5\u9519\u63d0\u793a\u663e\u793a\u627e\u4e0d\u5230eth0\u7f51\u5361\u3002<\/p>\n<p>2\uff09\u4ea7\u751f\u539f\u56e0\uff1a\u8fd9\u662f\u7531\u4e8e\u670d\u52a1\u5668\u66f4\u6362\u4e86\u4e3b\u677f\u6216\u7f51\u5361\uff0c\u5bfc\u81f4MAC\u5730\u5740\u53d1\u751f\u4e86\u53d8\u5316\u3002\u7cfb\u7edf\u52a0\u8f7d\u7f51\u5361\u9a71\u52a8\u540e\u4f1a\u8bfb\u53d6\u4e00\u4e2a\u6587\u4ef6\uff08\u5373\/etc\/udev\/rules.d\/70-persistent-net.rules\uff09\uff0c\u8be5\u6587\u4ef6\u662f\u4e00\u4e2a\u7f13\u5b58\u6587\u4ef6\uff0c\u5305\u542b\u4e86\u7f51\u5361\u7684MAC\u5730\u5740\u3002\u7531\u4e8e\u66f4\u6362\u4e86\u4e3b\u677f\uff0c\u7f51\u5361\u7684MAC\u5730\u5740\u4e5f\u53d1\u751f\u4e86\u53d8\u5316\uff0c\u4f46\u662f\u8be5\u6587\u4ef6\u4e2d\u7684MAC\u5730\u5740\u4ecd\u7136\u662f\u4e4b\u524d\u574f\u6389\u7684\u4e3b\u677f\u4e0a\u7f51\u5361\u7684MAC\u5730\u5740\u3002\u56e0\u6b64\uff0c\u5f53\u7cfb\u7edf\u52a0\u8f7d\u7f51\u5361\u5e76\u8bfb\u53d6\u8be5\u6587\u4ef6\u65f6\uff0c\u8bfb\u53d6\u7684\u662f\u4e4b\u524d\u7f51\u5361\u7684MAC\u5730\u5740\uff0c\u4e0e\u66f4\u6362\u540e\u7684\u4e3b\u677f\u4e0a\u7684\u7f51\u5361MAC\u5730\u5740\u4e0d\u4e00\u81f4\uff0c\u5bfc\u81f4\u6df7\u4e71\uff0c\u4ece\u800c\u65e0\u6cd5\u8bc6\u522b\u5f53\u524d\u7684\u7f51\u5361\u3002<\/p>\n<p>3\uff09\u89e3\u51b3\u65b9\u6cd5\uff1a\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u5220\u9664\/etc\/udev\/rules.d\/70-persistent-net.rules\u6587\u4ef6\uff08\u6216\u8005\u5c06\u5176\u91cd\u65b0\u547d\u540d\uff09\uff0c\u7136\u540e\u91cd\u65b0\u542f\u52a8\u670d\u52a1\u5668\u5373\u53ef\u89e3\u51b3\u95ee\u9898\u3002\u91cd\u542f\u540e\uff0c\u7cfb\u7edf\u4f1a\u91cd\u65b0\u751f\u6210\u8be5\u6587\u4ef6\uff0c\u4ece\u800c\u987a\u5229\u89e3\u51b3\u8be5\u95ee\u9898\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u7531\u4e8e\u6211\u7684\u670d\u52a1\u5668\u7ed1\u5b9a\u4e86\u7f51\u5361\uff0c\u56e0\u6b64\u5728\u91cd\u542f\u7f51\u5361\u540e\uff0c\u8fd8\u9700\u8981\u6267\u884cmodprobe\u547d\u4ee4\u4ee5\u4f7f\u7f51\u5361\u7ed1\u5b9a\u751f\u6548\u3002\u5927\u81f4\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<pre>[root@kevin network-scripts]# cat \/etc\/udev\/rules.d\/70-persistent-net.rules # This file was automatically generated by the \/lib\/udev\/write_net_rules # program, run by the persistent-net-generator.rules rules file. # # You can modify it, as long as you keep each rule on a single # line, and change only the value of the NAME= key.    # PCI device 0x14e4:0x1657 (tg3) SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"****\", ATTR{type}==\"1\", KERNEL==\"eth*\"    # PCI device 0x14e4:0x1657 (tg3) SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"****\", ATTR{type}==\"1\", KERNEL==\"eth*\"    # PCI device 0x14e4:0x1657 (tg3) SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"****\", ATTR{type}==\"1\", KERNEL==\"eth*\"    # PCI device 0x14e4:0x1657 (tg3) SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"****\", ATTR{type}==\"1\", KERNEL==\"eth*\"    \u7136\u540e\u91cd\u542f\u7f51\u5361\u7b49\u64cd\u4f5c [root@kevin ~]# modprobe bonding [root@kevin ~]# \/etc\/init.d\/network restart [root@kevin ~]# modprobe bonding<\/pre>\n<pre>[root@kevin ~]# ifconfig -a bond0     Link encap:Ethernet  HWaddr 08:94:EF:5E:AE:72           inet addr:192.168.10.20  Bcast:192.168.10.255  Mask:255.255.255.0           inet6 addr: fe80::a94:efff:fe5e:ae72\/64 Scope:Link           UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1           RX packets:108809 errors:0 dropped:0 overruns:0 frame:0           TX packets:84207 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0           RX bytes:8471111 (8.0 MiB)  TX bytes:6322341 (6.0 MiB)    eth0      Link encap:Ethernet  HWaddr 08:94:EF:5E:AE:72           UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1           RX packets:38051 errors:0 dropped:0 overruns:0 frame:0           TX packets:14301 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:2869726 (2.7 MiB)  TX bytes:944276 (922.1 KiB)           Interrupt:16    eth1      Link encap:Ethernet  HWaddr 08:94:EF:5E:AE:72           UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1           RX packets:69158 errors:0 dropped:0 overruns:0 frame:0           TX packets:68615 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:5469647 (5.2 MiB)  TX bytes:5279012 (5.0 MiB)           Interrupt:17    eth2      Link encap:Ethernet  HWaddr 08:94:EF:5E:AE:74           BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)           Interrupt:16    eth3      Link encap:Ethernet  HWaddr 08:94:EF:5E:AE:75           BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)           Interrupt:17    lo        Link encap:Local Loopback           inet addr:127.0.0.1  Mask:255.0.0.0           inet6 addr: ::1\/128 Scope:Host           UP LOOPBACK RUNNING  MTU:65536  Metric:1           RX packets:26 errors:0 dropped:0 overruns:0 frame:0           TX packets:26 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:0           RX bytes:1983 (1.9 KiB)  TX bytes:1983 (1.9 KiB)    usb0      Link encap:Ethernet  HWaddr 0A:94:EF:5E:AE:79           BROADCAST MULTICAST  MTU:1500  Metric:1           RX packets:0 errors:0 dropped:0 overruns:0 frame:0           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0           collisions:0 txqueuelen:1000           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)<\/pre>\n<p>\u91cd\u542f\u670d\u52a1\u5668\u540e\uff0c\u67e5\u770b\/etc\/udev\/rules.d\/70-persistent-net.rules\u6587\u4ef6\uff0c\u53d1\u73b0\u5176\u4e2d\u6ca1\u6709eth0\u3001eth1\u3001eth3\u3001eth4\u7f51\u5361\u7684\u4fe1\u606f\uff08\u5305\u62ecMAC\u5730\u5740\u548c\u8bbe\u5907\u540d\u79f0\uff09\u3002\u7136\u540e\u4f7f\u7528ifconfig\u547d\u4ee4\u67e5\u770b\uff0c\u53d1\u73b0eth0\u3001eth1\u3001eth2\u3001eth3\u7f51\u5361\u8bbe\u5907\u90fd\u80fd\u591f\u88ab\u8bc6\u522b\u3002<\/p>\n<pre>[root@kevin ~]# cat \/etc\/udev\/rules.d\/70-persistent-net.rules # This file was automatically generated by the \/lib\/udev\/write_net_rules # program, run by the persistent-net-generator.rules rules file. # # You can modify it, as long as you keep each rule on a single # line, and change only the value of the NAME= key.    # PCI device 0x14e4:0x1657 (tg3) SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"08:94:ef:5e:ae:75\", ATTR{type}==\"1\", KERNEL==\"eth*\", NAME=\"eth3\"    # PCI device 0x14e4:0x1657 (tg3) SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"08:94:ef:5e:ae:72\", ATTR{type}==\"1\", KERNEL==\"eth*\", NAME=\"eth0\"    # PCI device 0x14e4:0x1657 (tg3) SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"08:94:ef:5e:ae:73\", ATTR{type}==\"1\", KERNEL==\"eth*\", NAME=\"eth1\"    # PCI device 0x14e4:0x1657 (tg3) SUBSYSTEM==\"net\", ACTION==\"add\", DRIVERS==\"?*\", ATTR{address}==\"08:94:ef:5e:ae:74\", ATTR{type}==\"1\", KERNEL==\"eth*\", NAME=\"eth2\"<\/pre>\n<pre>[root@kevin ~]# ping 192.168.10.23 PING 192.168.10.23 (192.168.10.23) 56(84) bytes of data. 64 bytes from 192.168.10.23: icmp_seq=1 ttl=64 time=0.030 ms 64 bytes from 192.168.10.23: icmp_seq=2 ttl=64 time=0.016 ms 64 bytes from 192.168.10.23: icmp_seq=3 ttl=64 time=0.016 ms<\/pre>\n<pre>[root@kevin ~]# modprobe bonding<\/pre>\n<p>\u7ee7\u7eed\u67e5\u770b\/etc\/udev\/rules.d\/70-persistent-net.rules\u6587\u4ef6\uff0c\u53d1\u73b0\u5176\u4e2d\u5305\u542b\u4e86eth0\u3001eth1\u3001eth2\u3001eth3\u7f51\u5361\u53ca\u5176\u5bf9\u5e94\u7684MAC\u5730\u5740\u4fe1\u606f\u3002\u63a5\u7740\u5c1d\u8bd5\u4f7f\u7528ping\u547d\u4ee4\u8fdb\u884c\u5176\u4ed6\u673a\u5668\u7684\u8fde\u63a5\u3002\u5982\u679c\u65e0\u6cd5\u8fde\u63a5\uff0c\u5219\u53ef\u4ee5\u5c1d\u8bd5\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p><!-- \u6587\u7ae0\u6765\u6e90:https:\/\/www.mmcloud.com\/27885.html --><\/p>\n<p>\u6e29\u99a8\u63d0\u793a\uff1a\u6709\u65f6\u5019\u5373\u4f7f\u91cd\u542f\u540e\u4ecd\u7136\u51fa\u73b0\u4ee5\u4e0a\u60c5\u51b5\u3002\u6b64\u65f6\uff0c\u53ef\u4ee5\u5c06\u65b0\u7684\/etc\/udev\/rules.d\/70-persistent-net.rules\u6587\u4ef6\u4e0e\u4e4b\u524d\u7684\u6587\u4ef6\u8fdb\u884c\u5bf9\u6bd4\uff0c\u67e5\u770b\u65b0\u6587\u4ef6\u4e2d\u7684MAC\u5730\u5740\u548c\u540d\u79f0\u662f\u5426\u53d1\u751f\u4e86\u53d8\u5316\uff0c\u4f8b\u5982name=eth0\u4e0e\u4e4b\u524d\u7684name=em1\u4e0d\u540c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5927\u795e\u6559\u4f60\u5904\u7406Linux\u670d\u52a1\u5668\u7f51\u5361\u8bc6\u522b\u5931\u8d25\u7684\u65b9\u6cd51\uff09\u73b0\u8c61\u8bf4\u660e\u516c\u53f8IDC\u673a\u623f\u91cc\u7684\u4e00\u53f0\u7ebf\u4e0a\u670d\u52a1\u5668\u786c\u4ef6\u62a5\u8b66\uff0c\u6700\u540e\u6392\u67e5\u53d1\u73b0\u670d\u52a1\u5668\u4e3b\u677f\u574f\u4e86\uff0c\u968f\u5373\u8054\u7cfb\u5382\u5546\u8fdb\u884c\u66f4\u6362\u4e3b\u677f\uff0c\u6700\u540e\u66f4\u6362\u540e\uff0c\u767b\u5f55\u670d\u52a1\u5668\uff0c\u53d1\u73b0\u7f51\u5361\u7ed1\u5b9a\u53caip\u4fe1\u606f\u90fd\u5728\uff0c\u4f46\u662fip\u5374ping\u4e0d\u901a\u4e86<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"topic":[],"class_list":["post-1872","post","type-post","status-publish","format-standard","hentry","category-1"],"_links":{"self":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/posts\/1872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/comments?post=1872"}],"version-history":[{"count":0,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/posts\/1872\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/media?parent=1872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/categories?post=1872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/tags?post=1872"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.ccwifi.cc\/blogs\/wp-json\/wp\/v2\/topic?post=1872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}