【Linux】MAC名称修改、IP地址和MAC地址绑定
生活随笔
收集整理的這篇文章主要介紹了
【Linux】MAC名称修改、IP地址和MAC地址绑定
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
在虛擬機多網卡的環(huán)境中,有時IP會隨著網卡的重新啟動變得不一致,這時,就需要將IP地址和MAC進行綁定,有時也需要對網卡名稱進行修改,本篇將對此進行演示。
一 軟件環(huán)境
三 IP和MAC綁定 1、修改網卡信息 [root@strong ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 TYPE=Ethernet BOOTPROTO=none IPADDR=10.24.32.112 HWADDR=00:0C:29:7F:F9:AA --增加MAC PREFIX=23 GATEWAY=10.24.33.254 DNS1=10.24.2.33 DEFROUTE=yes IPV4_FAILURE_FATAL=yes IPV6INIT=no NAME=eth0 UUID=6bbe4c97-0f50-4c78-9be3-3242bbab17df ONBOOT=yes LAST_CONNECT=1523246127 2、重啟網卡 [root@strong ~]# service network restart Shutting down interface eth0: Device state: 3 (disconnected)[ OK ] Shutting down interface eth2: Device state: 3 (disconnected)[ OK ] Shutting down loopback interface: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: Active connection state: activated Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/6[ OK ] Bringing up interface eth2: Active connection state: activated Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/7[ OK ] [root@strong ~]# 綜上,實現(xiàn)了網卡名稱的修改和IP和MAC地址的綁定。
一 軟件環(huán)境
- VMware? Workstation 10.0.6
- CentOS-6.5-x86_64
三 IP和MAC綁定 1、修改網卡信息 [root@strong ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 TYPE=Ethernet BOOTPROTO=none IPADDR=10.24.32.112 HWADDR=00:0C:29:7F:F9:AA --增加MAC PREFIX=23 GATEWAY=10.24.33.254 DNS1=10.24.2.33 DEFROUTE=yes IPV4_FAILURE_FATAL=yes IPV6INIT=no NAME=eth0 UUID=6bbe4c97-0f50-4c78-9be3-3242bbab17df ONBOOT=yes LAST_CONNECT=1523246127 2、重啟網卡 [root@strong ~]# service network restart Shutting down interface eth0: Device state: 3 (disconnected)[ OK ] Shutting down interface eth2: Device state: 3 (disconnected)[ OK ] Shutting down loopback interface: [ OK ] Bringing up loopback interface: [ OK ] Bringing up interface eth0: Active connection state: activated Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/6[ OK ] Bringing up interface eth2: Active connection state: activated Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/7[ OK ] [root@strong ~]# 綜上,實現(xiàn)了網卡名稱的修改和IP和MAC地址的綁定。
總結
以上是生活随笔為你收集整理的【Linux】MAC名称修改、IP地址和MAC地址绑定的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 在Windows第一次使用使用vcpkg
- 下一篇: linux程序安装opt还是mnt,FH