Bug 9334 - MACADDR for vlan subif can not be set
: MACADDR for vlan subif can not be set
Status: CLOSED WONTFIX
: ALT Linux 2.4
(All bugs in ALT Linux 2.4/net-scripts)
: 2.4
: all Linux
: P2 normal
Assigned To:
:
:
:
:
:
  Show dependency tree
 
Reported: 2006-03-29 10:58 by
Modified: 2006-09-16 22:24 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2006-03-29 10:58:24
Having MACADDR specified in /etc/sysconfig/network-scripts/ifcfg-<eth>.<vlan>
file it is still not possible to change mac address, because of "ip set dev
<dev> addr <mac>" fails: mac address can not be changed when parent interface is up.

"Quick" patch:

--- ifup.orig   2006-03-29 09:45:49 +0300
+++ ifup    2006-03-29 09:52:05 +0300
@@ -214,7 +214,14 @@
 fi

 # set interface-specific parameters
-[ -n "$MACADDR" ] && ip link set dev "$DEVICE" address "$MACADDR"
+[ -n "$MACADDR" ] && \
+   ( "$DEVICE" = "$REALDEVICE" ] && \
+       ( ip link set dev "$DEVICE" address "$MACADDR" ) || \
+       ( ip link set dev "$REALDEVICE" down; \
+         ip link set dev "$DEVICE" address "$MACADDR"; \
+         ip link set dev "$REALDEVICE" up \
+       ) \
+   )
 [ -n "$MTU" ] &&     ip link set dev "$DEVICE" mtu $MTU
 ip link set dev "$DEVICE" $(ip_link_flag arp $ARP) $(ip_link_flag promisc
$PROMISC) \
 $(ip_link_flag allmulti $ALLMULTI) $(ip_link_flag multicast $MULTICAST)
------- Comment #1 From 2006-03-29 11:06:42 -------
> "Quick" patch:
> 
> --- ifup.orig   2006-03-29 09:45:49 +0300
> +++ ifup    2006-03-29 09:52:05 +0300
> @@ -214,7 +214,14 @@
>  fi
> 
>  # set interface-specific parameters
> -[ -n "$MACADDR" ] && ip link set dev "$DEVICE" address "$MACADDR"
> +[ -n "$MACADDR" ] && \
> +   ( "$DEVICE" = "$REALDEVICE" ] && \
        ^
Oops, a braket `[' missed, sorry.

That's a really "quick test", not tested almost at all.
------- Comment #2 From 2006-03-29 21:53:53 -------
Предложенный способ, например, удалит статические маршруты с родительского
интерфейса.
------- Comment #3 From 2006-08-27 21:16:30 -------
Я тут посмотрел и понял, что в /etc/net такая же недоработка. Попробую
исправить
в 0.8.4, чтобы была рабочая альтернатива.
------- Comment #4 From 2006-09-10 01:39:15 -------
В SVN trunk /etc/net назначение MAC-адресов VLAN-интерфейсам исправлено,
поэтому
невозможность (или неудобство) сделать так в net-scripts я объявляю WONTFIX.
------- Comment #5 From 2006-09-16 22:24:49 -------
Версия 0.8.4 опубликована.