CentOS 7阿里云服务器IP地址和MAC地址绑定
生活随笔
收集整理的這篇文章主要介紹了
CentOS 7阿里云服务器IP地址和MAC地址绑定
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在CentOS 7阿里云服務器把IP地址和MAC地址綁定,網上起初搜索到的方法都不行。以下是后來根據報錯搜索到的結果。
其實,到底有沒有綁定成功我也不太確定。雖然,執行“arp”命令、“arp -a”命令都能找到綁定記錄,但我還是不放心。
[root@iZ236166figZ?~]#?ifconfig docker0:?flags=4099<UP,BROADCAST,MULTICAST>??mtu?1500inet?192.168.0.1??netmask?255.255.240.0??broadcast?0.0.0.0ether?02:42:c4:da:39:9e??txqueuelen?0??(Ethernet)RX?packets?90553??bytes?9116677?(8.6?MiB)RX?errors?0??dropped?0??overruns?0??frame?0TX?packets?130887??bytes?195002426?(185.9?MiB)TX?errors?0??dropped?0?overruns?0??carrier?0??collisions?0eth0:?flags=4163<UP,BROADCAST,RUNNING,MULTICAST>??mtu?1500inet?10.253.43.165??netmask?255.255.248.0??broadcast?10.253.47.255ether?00:16:3e:00:0d:b7??txqueuelen?1000??(Ethernet)RX?packets?1705153533??bytes?384820555809?(358.3?GiB)RX?errors?0??dropped?0??overruns?0??frame?0TX?packets?589976960??bytes?480870664184?(447.8?GiB)TX?errors?0??dropped?11?overruns?0??carrier?0??collisions?0eth1:?flags=4163<UP,BROADCAST,RUNNING,MULTICAST>??mtu?1500inet?118.178.12.16??netmask?255.255.254.0??broadcast?118.178.13.255ether?00:16:3e:00:07:5e??txqueuelen?1000??(Ethernet)RX?packets?5530935427??bytes?256025183196?(238.4?GiB)RX?errors?0??dropped?0??overruns?0??frame?0TX?packets?48853685??bytes?27799365139?(25.8?GiB)TX?errors?0??dropped?0?overruns?0??carrier?0??collisions?0lo:?flags=73<UP,LOOPBACK,RUNNING>??mtu?65536inet?127.0.0.1??netmask?255.0.0.0loop??txqueuelen?0??(Local?Loopback)RX?packets?12958790??bytes?832306490?(793.7?MiB)RX?errors?0??dropped?0??overruns?0??frame?0TX?packets?12958790??bytes?832306490?(793.7?MiB)TX?errors?0??dropped?0?overruns?0??carrier?0??collisions?0綁定IP地址和MAC地址:
[root@iZ236166figZ?~]#?arp?-s?10.253.43.165?-H?ether?00:16:3e:00:0d:b7?-i?eth0 [root@iZ236166figZ?~]#?arp?-s?118.178.12.16?-H?ether?00:16:3e:00:07:5e?-i?eth1加入開機自啟動項:
[root@iZ236166figZ?~]#?echo?"arp?-s?10.253.43.165?-H?ether?00:16:3e:00:0d:b7?-i?eth0"?>>/etc/rc.local [root@iZ236166figZ?~]#?echo?"arp?-s?118.178.12.16?-H?ether?00:16:3e:00:07:5e?-i?eth1"?>>/etc/rc.local [root@iZ236166figZ?~]#?cat?/etc/rc.local? #!/bin/bash #?THIS?FILE?IS?ADDED?FOR?COMPATIBILITY?PURPOSES # #?It?is?highly?advisable?to?create?own?systemd?services?or?udev?rules #?to?run?scripts?during?boot?instead?of?using?this?file. # #?In?contrast?to?previous?versions?due?to?parallel?execution?during?boot #?this?script?will?NOT?be?run?after?all?other?services. # #?Please?note?that?you?must?run?'chmod?+x?/etc/rc.d/rc.local'?to?ensure #?that?this?script?will?be?executed?during?boot.touch?/var/lock/subsys/local arp?-s?10.253.43.165?-H?ether?00:16:3e:00:0d:b7?-i?eth0 arp?-s?118.178.12.16?-H?ether?00:16:3e:00:07:5e?-i?eth1CentOS 7之后,/etc/rc.local文件一般需要增加執行權限,才能在重啟服務器后,運行里面的命令。
[root@iZ236166figZ?~]#?ll?/etc/rc.d/rc.local? -rw-r--r--?1?root?root?585?Aug??5?14:51?/etc/rc.d/rc.local [root@iZ236166figZ?~]#?chmod?+x?/etc/rc.d/rc.local? [root@iZ236166figZ?~]#?ll?/etc/rc.d/rc.local??????? -rwxr-xr-x?1?root?root?585?Aug??5?14:51?/etc/rc.d/rc.local總結
以上是生活随笔為你收集整理的CentOS 7阿里云服务器IP地址和MAC地址绑定的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 企业办理ISO认证的四大关注点!
- 下一篇: 【机器学习-贷款用户逾期情况分析2】3.