# изменение mac адреса для ip камеры axis

**URL:** <https://linux.ru/forum/t/mac-ip-axis/10369>\
**Category:** Вопросы по серверам и сетям\
**Created:** [16.Июль.2015 15:06:27 UTC](https://linux.ru/forum/t/mac-ip-axis/10369 "2015-07-16T15:06:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ctudent](https://linux.ru/forum/letter_avatar_proxy/v4/letter/c/b38774/32.png) [@ctudent](https://linux.ru/forum/u/ctudent)\
**Post date:** [16.Июль.2015 15:06:27 UTC](https://linux.ru/forum/t/mac-ip-axis/10369/1 "2015-07-16T15:06:27Z")

</div>

Добрый день!  
Прошу помощи/совета&nbsp;в следующем - необходимо изменить mac-адрес ip камеры axis, которая работает на linux.

В веб-морде есть возможность редактирования конфигов, папки etc/network нет, есть файлы init.d/net.eth0 и&nbsp;init.d/mac

В скрипте&nbsp;init.d/eth0 вызывается скрипт&nbsp;init.d/mac

Вот содержимое скрипта&nbsp;init.d/mac

Пробовал вместо MAC=$MAC написать MAC=“нужный мас” но адрес всё равно не поменялся…

```
#!/bin/sh

. /etc/init.d/functions.sh
[! -f /etc/conf.d/mac] || . /etc/conf.d/mac

default_mac=00:40:8C:CD:00:00

begin "Determining MAC address"

if ["$MAC"]; then
	MAC=$(echo $MAC | tr a-f A-F)
else
	MAC=$default_mac
fi

if [$MAC = $default_mac]; then
	serno=
	! exists bootblocktool || serno=$(bootblocktool -x SERNO || :)
	if [-z "$serno"]; then
		warning "Cannot determine serial number."
		information "No serial number, using default MAC address: $MAC"
		setled -l statusled -c red -d none -i 1 -s LED_STATE_SERNO_ERROR
	else
		# Use serial number with colons added.
		MAC=$(echo $serno | tr a-f A-F |
			sed -re 's/([0-9A-F]{2})/\1:/g;s/:$//')
		information "Using serial number as MAC address: $MAC"
	fi

	# Only write to the config-file if needed.
	if ["$MAC" != $default_mac] || [! -f /etc/conf.d/mac]; then
		# Write the new address to the config-file.
		cat <<-EOT >/etc/conf.d/mac
			# This file was automatically generated by '$0'
			# to be used by the net-scripts if the conf-file of a
			# net-script doesn't define MAC.
			#
			# Change MAC if you want a MAC address different than
			# the serial number.

			MAC=$MAC
		EOT
		information "MAC address saved: $MAC"
	fi
else
	information "Using saved MAC address: $MAC."
fi

end $?

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![Firebird](https://linux.ru/forum/letter_avatar_proxy/v4/letter/f/2acd7d/32.png) [@Firebird](https://linux.ru/forum/u/Firebird)\
**Post date:** [16.Июль.2015 19:35:45 UTC](https://linux.ru/forum/t/mac-ip-axis/10369/2 "2015-07-16T19:35:45Z")

</div>

MAC адрес задается тут:&nbsp;

```
/etc/conf.d/mac 

```

Вызов

&nbsp;init.d/mac

Я бы вообще закоментировал - в этом скрипте, как видно, генерируется MAC адрес на основе серийного номера устройства

---

<div class="post-metadata">

**Author:** ![ctudent](https://linux.ru/forum/letter_avatar_proxy/v4/letter/c/b38774/32.png) [@ctudent](https://linux.ru/forum/u/ctudent)\
**Post date:** [20.Июль.2015 12:41:58 UTC](https://linux.ru/forum/t/mac-ip-axis/10369/3 "2015-07-20T12:41:58Z")

</div>

Спасибо огромное!!!

Все оказалось проще - я не увидел папки /etc/conf.d
