Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to spoof the MAC address in Solaris 10, running in a ESXi VM. The MAC I need is outside the range permitted by vSphere.

So I add an "ether" entry to /etc/hostname.e1000g0 so the file says

abchost01

ether 1:2:3:4:5:6

and reboot. To my horror, the netmask is now ff000000. It was fffffe00 before. so I add

netmask 255.255.254.0

to /etc/hostname.e1000g0

and reboot. ifconfig -a looks fine at first glance, but can't ping the IP. To my horror, the broadcast address is now 10.255.255.255, instead of 10.182.217.255.

What can I do to set the MAC addy with config files in Solaris 10? I have tried a rc.local approach using SMF to fire it off. What an absolute pain it is to work with SMF. I'd rather do this using config files. In Windows and Linux I would have done this in 10 seconds - but Solaris has beaten me up badly. Help please.

share|improve this question
1  
try put hostname and ether in one line. The system thinks 10.0.0.0/8 network is a class A network so that's the mask. You can override this in /etc/netmasks. –  inntran Sep 14 '12 at 18:14
add comment

1 Answer 1

I had a look at this in a VM earlier. I noticed that when I had

hostname
ether 10:20:30:40:50:60

in /etc/hostname.e1000g0, when the system booted it logged an error for

Sep 15 20:10:46 hostname svc.startd[7]: [ID 748625 daemon.error] network/physical :default misconfigured: transitioned to maintenance (see 'svcs -xv' for details)

Looking at the e1000g0 interface we see

e1000g0: flags=1000843<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
    inet 192.168.1.68 netmask ffffff00 broadcast 192.168.1.255
    ether 0:c:29:25:22:f8

As you say this looks normal but it's not, it's not UP so it won't respond to pings etc. This would explain your horrors!

To change the mac address you have to put the hostname and ether address on the same line

hostname ether 10:20:30:40:50:60

then after a reboot looking at e1000g0 we see

e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
    inet 192.168.1.68 netmask ffffff00 broadcast 192.168.1.255
    ether 10:20:30:40:50:60

which is what you want.

share|improve this answer
    
That worked. All the options one line does this trick. Ok, so does anyone know where this /etc/hostname.{nic} format documented? I have been googling for days. Or perhaps this is just "common knowledge" for Solaris admins.... –  Jepper Sep 19 '12 at 14:18
    
@Jepper: I haven't found it documented anywhere, in fact the only documentation I've found is docs.oracle.com/cd/E19455-01/806-0916/ipconfig-13/index.html –  Iain Sep 19 '12 at 15:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.