免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1823 | 回复: 9
打印 上一主题 下一主题

SUN几种机型的MAC地址修改方法 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-07-29 15:42 |只看该作者 |倒序浏览
今日,偶然得到一个文档,讲述怎样修改MAC地址。
摘录了一些内容如下,主要是通过mkp命令修改IDPROM的设置:
General sun4c, sun4m, sun4d, sun4u IDPROM Programming
If you have a valid NVRAM chip installed (IDPROM is ok) then before doing anything else, write down a copy of the IDPROM information. You can get it under Sun OS 4.1.x by running /usr/etc/devinfo -vp or under Solaris 2.x by executing /usr/sbin/prtconf -vp. Alternatively you can get the IDPROM information at the OpenBoot monitor "ok" prompt by typing the command .idprom (yes the "." is part of the command). You'll need this information if the NVRAM gets screwed up and you need to try and back out.

Step 1.
Go to the OpenBoot monitor (ok prompt). You can do this by turning on your machine, pressing L1/Stop-A to interrupt the boot sequence, and entering "new command mode". Alternatively, if your machine is running, just shut down your operating system.

If you are installing a new NVRAM type set-defaults followed by the <Enter>; key and then setenv diag-switch? false followed by the <Enter>; key.

Generally a machine will reset the NVRAM to the default values (excluding the IDPROM information) when it detects a new NVRAM. Still, it is good to do a set-defaults just in case this fails.

Step 2.
The command to reprogram the IDPROM part of NVRAM is "mkp". The format for the command is

<value>; <location>; mkp

where location is read off the following table (all values are in hexadecimal). Note that some Sun clones (e.g. Tatung COMPstation 25 with TWS boot PROM REV 1.7) don't have an "mkp" command. If "mkp" doesn't work on your system, see the section below entitled Other more arcane methods for modifying the IDPROM.

byte(s) contents
0 always 01 - format/version number
1 first byte of hostid (machine type)
2-7 6 byte ethernet address (first three bytes should be 08,00,20)
8-b date of manufacture (usually all 0s, doesn't really matter)
c second byte of hostid
d third byte of hostid
e fourth byte of hostid
f IDPROM checksum - bitwise xor of bytes 0-e

As mentioned above, you can look at the complete idprom by executing .idprom. Bytes c through e in the table above are collectively referred to as the serial number. If you convert the concatenation of bytes c-e to decimal, this is the serial number you see when you turn the machine on.

Alternatively, you can use the idprom@ command to get a particular byte from the IDPROM

<location>; idprom@

returns the IDPROM value of byte <location>;

so

<location>; idprom@ .

prints the IDPROM value of byte <location>; because . is the FORTH command to print the value on the bottom of the stack.

Now make the changes using mkp. Be very careful and be sure to compute the checksum after making changes. If you don't, you'll get nasty warnings about an incorrect IDPROM checksum on boot. A quick and dirty way to compute and store the checksum in location f is to execute the following at the "ok" prompt _after_ you have made your changes to locations 0-e.

0 f 0 do i idprom@ xor loop f mkp

Don't change the first byte of the hostid to something that doesn't correspond to your system type (see table below). Similarly, the first three bytes of the ethernet address should be (08,00,20). The first byte of the hostid is often used to determine the architecture when booting from CDROM on some Sun models. If you don't set the first three bytes of the ethernet address to 08,00,20 you might get message which says that you have a defective motherboard (but then I don't know of any other consequences of changing this to some reasonable value, especially avoid ff:ff:ff:ff:ff:ff !. On some systems you can get away with changing the first three bytes of the ethernet address to more or less anything you want).

If you'd rather not use the table below, you can find out what you should make the first byte of the hostid by typing real-machine-type . at the "ok" prompt. Note that real-machine-type may not be defined on some machines with older boot proms.

e.g. modify the hostid of an IPX to be 57c0ffee and the ethernet address to be 08:00:20:c0:ff:ee. At the OpenBoot monitor prompt (ok)

1 0 mkp
real-machine-type 1 mkp
8 2 mkp
0 3 mkp
20 4 mkp
c0 5 mkp
ff 6 mkp
ee 7 mkp
0 8 mkp
0 9 mkp
0 a mkp
0 b mkp
c0 c mkp
ff d mkp
ee e mkp
0 f 0 do i idprom@ xor loop f mkp

Step 3.
If you are on an SS1000, type update-system-idprom at the OpenBoot PROM "ok" prompt.

For any of the above machines, now type reset at the ok prompt. Your machine should then attempt to reboot with your new hostid/enet addr.

论坛徽章:
7
荣誉会员
日期:2011-11-23 16:44:17水瓶座
日期:2013-08-28 21:20:16丑牛
日期:2013-10-02 21:01:462015年迎新春徽章
日期:2015-03-04 09:54:45操作系统版块每日发帖之星
日期:2016-06-05 06:20:0015-16赛季CBA联赛之吉林
日期:2016-06-20 08:24:0515-16赛季CBA联赛之四川
日期:2016-08-18 15:02:02
2 [报告]
发表于 2004-07-29 18:11 |只看该作者

SUN几种机型的MAC地址修改方法

此法实在是有点复杂。

论坛徽章:
0
3 [报告]
发表于 2004-07-29 18:13 |只看该作者

SUN几种机型的MAC地址修改方法

那有没有比较简单一点的方法呢.感觉没有这样做过的经历.

论坛徽章:
7
荣誉会员
日期:2011-11-23 16:44:17水瓶座
日期:2013-08-28 21:20:16丑牛
日期:2013-10-02 21:01:462015年迎新春徽章
日期:2015-03-04 09:54:45操作系统版块每日发帖之星
日期:2016-06-05 06:20:0015-16赛季CBA联赛之吉林
日期:2016-06-20 08:24:0515-16赛季CBA联赛之四川
日期:2016-08-18 15:02:02
4 [报告]
发表于 2004-07-29 18:18 |只看该作者

SUN几种机型的MAC地址修改方法

ok 0 0 mkp
ok 8 0 20 nn nn nn hostid mkpl
ctrl-d
ctrl-r
注意hostid是十六进制的数字。

论坛徽章:
0
5 [报告]
发表于 2004-07-29 18:20 |只看该作者

SUN几种机型的MAC地址修改方法

nn nn nn 这个是指定的什么呢.是你要修改的MAC地址呢.还是直接输入nn nn nn 就可以了.

论坛徽章:
0
6 [报告]
发表于 2004-07-29 22:55 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
7 [报告]
发表于 2004-07-30 15:30 |只看该作者

SUN几种机型的MAC地址修改方法

以前用过,enterprise/sparc II系列可以

论坛徽章:
0
8 [报告]
发表于 2004-07-30 16:42 |只看该作者

SUN几种机型的MAC地址修改方法

不发表意见,

论坛徽章:
0
9 [报告]
发表于 2004-07-30 16:46 |只看该作者

SUN几种机型的MAC地址修改方法

我这样做过,好像后来的机器就改不了了,像SF280我就没改成功!

论坛徽章:
0
10 [报告]
发表于 2004-07-30 16:50 |只看该作者

SUN几种机型的MAC地址修改方法

mkp早就不能用了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP