You are not logged in.

#1 2011-07-10 17:14:32

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 613

[solved] MAC address spoofing on boot

Currently rc.conf contains just

interface=eth0

I'd want to spoof MAC address the same way I do it in my network script

ifconfig eth0 hw ether XX:XX:XX:XX:XX:XX

during boot process also. Where to insert/add the command?

Last edited by student975 (2011-07-11 04:56:23)


"I exist" is the best myth I know..

Offline

#2 2011-07-10 18:09:35

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [solved] MAC address spoofing on boot

Offline

#3 2011-07-10 18:31:30

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 613

Re: [solved] MAC address spoofing on boot

Yes, it works. I have thought there is a way to keep rc.multi file intact.

Last edited by student975 (2011-07-10 18:32:13)


"I exist" is the best myth I know..

Offline

#4 2011-07-10 18:34:39

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [solved] MAC address spoofing on boot

There is - use netcfg instead.

Editing any of the base system initscripts is a bad idea, as the changes will be overwritten in the next upgrade.

Offline

#5 2011-07-10 19:10:23

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 613

Re: [solved] MAC address spoofing on boot

tomk wrote:

There is - use netcfg instead.

I'm not sure I want to use netcfg. rc.multi declares hooks. Unfortunately I have no idea how to catch them.


"I exist" is the best myth I know..

Offline

#6 2011-07-10 22:09:09

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [solved] MAC address spoofing on boot

Right, initscript hooks - I always forget about them. smile

Go to line 315 of /etc/rc.d/functions, it's explained there.

Offline

#7 2011-07-11 04:57:11

student975
Member
From: Russian Federation
Registered: 2011-03-05
Posts: 613

Re: [solved] MAC address spoofing on boot

tomk wrote:

Go to line 315 of /etc/rc.d/functions, it's explained there.

Thanks! - the issue is resoved.


"I exist" is the best myth I know..

Offline

#8 2011-08-05 11:27:58

dif
Member
From: Stalowa Wola, Poland
Registered: 2009-12-22
Posts: 137

Re: [solved] MAC address spoofing on boot

I know the issue is declared as solved, but what did the trick for me is this:

In the rc.conf file I wrote:

  interface="eth0 address 00:11:22:33:44:55"
  address=
  netmask=
  broadcast=
  gateway=

I did use netcfg to connect, but netcfg does not seem to spoof "pre-up" MAC addresses at boot, so I am pretty sure that the line interface="eth0 address 00:11:22:33:44:55" made automated connection possible.
The contents of my net profile file for netcfg were as follows:

  CONNECTION='ethernet'
  DESCRIPTION='DOM'
  INTERFACE='eth0'
  IP='dhcp'
  PRE_UP="ifconfig eth0 hw ether 00:11:22:33:44:55" #this line probably not necessary, at least not at boot

-----------------------------------
Before I used the following line in the rc.conf file:
  eth0="eth0 192.168.XXX.YYY netmask 255.255.255.0 broadcast 192.168.XXX.255 hw ether 00:11:22:33:44:55"
-----------------------------------

Hope this helps if not you (because you have solved the problem), then all those who look for an easy solution.

Offline

Board footer

Powered by FluxBB