LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1393|回复: 12

linux中改网卡mac(物理地址)

[复制链接]
发表于 2002-12-26 14:03:17 | 显示全部楼层 |阅读模式
linux中改网卡mac(物理地址)的命令是怎样的?

我以前在本论坛里看到过,但现在怎么搜也搜不到了。
发表于 2002-12-26 16:47:03 | 显示全部楼层
ifconfit eth0 hw <MAC Address>
 楼主| 发表于 2002-12-26 16:59:31 | 显示全部楼层
好象不行。
[root@silver root]# ifconfit eth1 hw <11:11:11:11:11:11>
bash: syntax error near unexpected token `newline'
[root@silver root]# ifconfig eth1 hw <11:11:11:11:11:11>
bash: syntax error near unexpected token `newline'
[root@silver root]# ifconfit eth1 hw 11:11:11:11:11:11
bash: ifconfit: command not found
[root@silver root]# ifconfig eth1 hw 11:11:11:11:11:11
Usage:
  ifconfig [-a] [-i] [-v] [-s] <interface> [[<AF>] <address>]
  [add <address>[/<prefixlen>]]
  [del <address>[/<prefixlen>]]
  [[-]broadcast [<address>]]  [[-]pointopoint [<address>]]
  [netmask <address>]  [dstaddr <address>]  [tunnel <address>]
  [outfill <NN>] [keepalive <NN>]
  [hw <HW> <address>]  [metric <NN>]  [mtu <NN>]
  [[-]trailers]  [[-]arp]  [[-]allmulti]
  [multicast]  [[-]promisc]
  [mem_start <NN>]  [io_addr <NN>]  [irq <NN>]  [media <type>]
  [txqueuelen <NN>]
  [[-]dynamic]
  [up|down] ...

  <HW>=Hardware Type.
  List of possible hardware types:
    loop (Local Loopback) slip (Serial Line IP) cslip (VJ Serial Line IP)
    slip6 (6-bit Serial Line IP) cslip6 (VJ 6-bit Serial Line IP) adaptive (Adaptive Serial Line IP)
    strip (Metricom Starmode IP) ash (Ash) ether (Ethernet)
    tr (16/4 Mbps Token Ring) tr (16/4 Mbps Token Ring (New)) ax25 (AMPR AX.25)
    netrom (AMPR NET/ROM) rose (AMPR ROSE) tunnel (IPIP Tunnel)
    ppp (Point-to-Point Protocol) hdlc ((Cisco)-HDLC) lapb (LAPB)
    arcnet (ARCnet) dlci (Frame Relay DLCI) frad (Frame Relay Access Device)
    sit (IPv6-in-IPv4) fddi (Fiber Distributed Data Interface) hippi (HIPPI)
    irda (IrLAP) ec (Econet) x25 (generic X.25)
  <AF>=Address family. Default: inet
  List of possible address families:
    unix (UNIX Domain) inet (DARPA Internet) inet6 (IPv6)
    ax25 (AMPR AX.25) netrom (AMPR NET/ROM) rose (AMPR ROSE)
    ipx (Novell IPX) ddp (Appletalk DDP) ec (Econet)
    ash (Ash) x25 (CCITT X.25)
[root@silver root]#
发表于 2002-12-27 18:00:00 | 显示全部楼层
请勿用于危害他人的用途!!
ifconfig eth1 down
ifconfig eth1 hw ether 01:01:01:01:01:01
/etc/init.d/network restart
 楼主| 发表于 2002-12-29 00:49:18 | 显示全部楼层
是可以改。
但重起之后就恢复成原来的了。
请问楼上的兄弟是不是这样的?
发表于 2002-12-29 17:05:37 | 显示全部楼层
把命令加到启动菜单!
 楼主| 发表于 2002-12-29 19:41:37 | 显示全部楼层
这道也是个不错的方法。
发表于 2002-12-30 13:44:27 | 显示全部楼层
物理地址怎么可能给你随便改?好象是厂商做在rom中的!
 楼主| 发表于 2002-12-30 14:55:59 | 显示全部楼层
楼上兄弟使用上面的命令试试。
是可以改,只要不重起。
我就曾经把我的8029和8139的mac改成了:
11:11:11:11:11:11
22:22:22:22:22:22
不过一重起就还原了
发表于 2002-12-31 00:37:31 | 显示全部楼层

不能吧!

因为网卡的物理地址即48bMAC地址是由世界上有个专门的组织
负责为网卡厂家分配的.以保证MAC地址的唯一性.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表