【hadoop】 1007-如何建立网卡和MAC地址的关联
来源:互联网 发布:经典java编程面试题 编辑:程序博客网 时间:2024/05/14 21:38
1、如何修改eth3 为eth0,并且eth0 和 192.168.2.31绑定
[hadoop@cloud01 .ssh]$ ifconfig
eth3 Link encap:Ethernet HWaddr 00:0C:29:D5:4D:6E
inet addr:192.168.2.31 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fed5:4d6e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9168 errors:0 dropped:0 overruns:0 frame:0
TX packets:9717 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:879381 (858.7 KiB) TX bytes:2297665 (2.1 MiB)
Interrupt:19 Base address:0x2024
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:16436 Metric:1
RX packets:47128 errors:0 dropped:0 overruns:0 frame:0
TX packets:47128 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7594343 (7.2 MiB) TX bytes:7594343 (7.2 MiB)
eth3 Link encap:Ethernet HWaddr 00:0C:29:D5:4D:6E
inet addr:192.168.2.31 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fed5:4d6e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9168 errors:0 dropped:0 overruns:0 frame:0
TX packets:9717 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:879381 (858.7 KiB) TX bytes:2297665 (2.1 MiB)
Interrupt:19 Base address:0x2024
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:16436 Metric:1
RX packets:47128 errors:0 dropped:0 overruns:0 frame:0
TX packets:47128 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7594343 (7.2 MiB) TX bytes:7594343 (7.2 MiB)
2、找到网卡和MAC映射文件
[hadoop@cloud01 ~]$ sudo find /etc/ -name "*net.rules"
[sudo] password for hadoop:
/etc/udev/rules.d/70-persistent-net.rules
[sudo] password for hadoop:
/etc/udev/rules.d/70-persistent-net.rules
3、修改网卡和MAC映射文件
修改前:
[hadoop@cloud01 ~]$ vi /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 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:3c:bf:e7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x1022:0x2000 (vmxnet)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:df:da:d1", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x1022:0x2000 (vmxnet)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:de:84:a7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x1022:0x2000 (vmxnet)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:d5:4d:6e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
# 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 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:3c:bf:e7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
# PCI device 0x1022:0x2000 (vmxnet)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:df:da:d1", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
# PCI device 0x1022:0x2000 (vmxnet)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:de:84:a7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
# PCI device 0x1022:0x2000 (vmxnet)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:d5:4d:6e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"
修改后:
[hadoop@cloud01 ~]$ sudo vi /etc/udev/rules.d/70-persistent-net.rules
[hadoop@cloud01 ~]$ more /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 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:d5:4d:6e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
[hadoop@cloud01 ~]$ more /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 0x1022:0x2000 (pcnet32)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:d5:4d:6e", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
4、sudo vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
TYPE=Ethernet
BOOTPROTO="static"
IPADDR=192.168.2.31
PREFIX=24
GATEWAY=192.168.2.1
NETMASK="255.255.255.0"
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=nod
UUID=5f068003-422b-4dfc-a417-15535b85c4aa
ONBOOT=yes
LAST_CONNECT=1418095247
TYPE=Ethernet
BOOTPROTO="static"
IPADDR=192.168.2.31
PREFIX=24
GATEWAY=192.168.2.1
NETMASK="255.255.255.0"
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=nod
UUID=5f068003-422b-4dfc-a417-15535b85c4aa
ONBOOT=yes
LAST_CONNECT=1418095247
5、reboot
6、重新查看
hadoop@cloud01 ~]$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:D5:4D:6E
inet addr:192.168.2.31 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fed5:4d6e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:43 errors:0 dropped:0 overruns:0 frame:0
TX packets:46 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4950 (4.8 KiB) TX bytes:6512 (6.3 KiB)
Interrupt:19 Base address:0x2024
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:16436 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:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
eth0 Link encap:Ethernet HWaddr 00:0C:29:D5:4D:6E
inet addr:192.168.2.31 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fed5:4d6e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:43 errors:0 dropped:0 overruns:0 frame:0
TX packets:46 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4950 (4.8 KiB) TX bytes:6512 (6.3 KiB)
Interrupt:19 Base address:0x2024
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:16436 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:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
0 0
- 【hadoop】 1007-如何建立网卡和MAC地址的关联
- 如何修改网卡的MAC地址
- 如何修改网卡的MAC地址?
- 取得网卡的ip和mac地址
- VMWARE修改网卡类型和网卡MAC地址的方法
- 如何修改网卡mac地址
- 获取网卡的mac和指定ip地址的mac
- vb获得本地和远程的MAC地址 (网卡地址)
- 获取网卡的MAC地址和IP地址
- vb获得本地和远程的MAC地址 (网卡地址)
- 获取客户端网卡MAC地址和IP地址的方法
- 在VMware workstation 9中如何查看和更改虚拟机的网卡MAC地址?
- 如何改变Linux的网卡的MAC地址
- 关于如何修改网卡MAC地址的方法
- 如何修改网卡的MAC(物理)地址
- Linux学习教程之如何改变网卡的mac地址
- 修改网卡的mac地址
- 获取网卡的mac地址
- yii中常用路径
- Annotation(四)——Struts2注解开发
- 【hadoop】 1006-ssh免登陆
- yii 常用路径
- 【tcp网络编程】用Socket建立一个简单的文本转换服务器
- 【hadoop】 1007-如何建立网卡和MAC地址的关联
- Marvin_wu-嵌入式 - fpga-DSP领域
- Eclipse搭建Struts2
- 启动受管Server报错,自己犯了弱智问题
- http://blog.csdn.net/huanghuanghbc/article/details/9357629
- 我的技术路线小结2(2011-2014)
- java时间方面的知识点
- wgwg
- TNS-12541: TNS:no listener