Koozali.org: home of the SME Server
Obsolete Releases => SME Server 9.x => Topic started by: cattledog on June 19, 2016, 10:26:20 AM
-
Hi all want to change my wan mac address to a new one so my isp allows my connection but would like this to be permanent not revert back after reboot.
Cheers
yes I have searched but they are older versions of sme and not sure if this would apply to sme9x
-
and what are the result of your search ?
-
and what are the result of your search ?
Nothing relevant for sme9...
-
Nothing relevant for sme9...
if it is related to any linux distro based on rpm ( or even any linux) , it might just need some adaptations we might be able to suggest.
-
cattledog: please give us the links to the topics you foud.. even if not SME9 related, they can be a good start point
-
https://en.wikibooks.org/wiki/Changing_Your_MAC_Address/Linux
-
yes I have searched but they are older versions of sme and not sure if this would apply to sme9x
please give us the results, thank you (I mean results from contribs.org first)
-
https://en.wikibooks.org/wiki/Changing_Your_MAC_Address/Linux
well this is totally adapted to SME !
for a temp change ( assuming your external network is eth0)
/etc/init.d/networking stop
ifconfig eth0 hw ether 02:01:02:03:04:08
/etc/init.d/networking start
Execute "ifconfig eth0" to confirm.
then to get it permanent to reboot :
In Red Hat Enterprise Linux (RHEL) and other similar systems (Fedora, CentOS, etc.) an easy way to make changes "permanent" across reboots is to add an appropriate entry to the /etc/sysconfig/network-scripts/ifcfg-ethN file (ifcfg-eth0 for the first Ethernet interface config file, ifcfg-eth1 - for the second, etc.):
MACADDR=12:34:56:78:90:ab
then for SME for making it permanent to reconfiguration, you will have to make it in a template
mkdir -p /etc/e-smith/templates-custom/etc/sysconfig/network-scripts/ifcfg-ethX/
vim /etc/e-smith/templates-custom/etc/sysconfig/network-scripts/ifcfg-ethX/10HWADDR
and add something like this
{
$OUT = "";
return if ($InternalInterface{Name} eq "bond0");
return unless $THIS_DEVICE =~ /^eth[01]$/;
my
my $MACaddr = $is_internal ?
'': $ExternalInterface{MACaddr};
return if $MACaddr eq '';
$OUT .= "MACADDR=$MACaddr " ;
}
then do
config setprop ExternalInterface MACaddr 12:34:56:78:90:ab
test the template with
expand-template /etc/sysconfig/network-scripts/ifcfg-eth0
again assuming your actual external network is eth0 ( adapt to eth1 or anything else if it is different)
Warning NOT TESTED, there might be some typos
-
Yes...thank you.
I was thinking that it was going to help.
By the way I sent an email and it was intended for you Jean-Philippe Pialasse about the way you did this:
Does anybody has already to configure such connection directly in SME with the modem bridged ?? ( no login, no password, fixed IP, unknown gateway IP)
How did you handle it ?
It was something you did back in 2013...I was after instruction that you followed.
https://forums.contribs.org/index.php/topic,49927.msg250224.html#msg250224
cheers
-
AFAICS in templates/etc/sysconfig/network-scripts/ifcfg-ethX/10HWADDR fragment, a
config setprop ExternalInterface HWAddress 12:34:56:78:90:ab
followed by proper action/event should be enough (and it is so at least since SME8)
NOTE: edited the key name
-
Yes...thank you.
I was thinking that it was going to help.
By the way I sent an email and it was intended for you Jean-Philippe Pialasse about the way you did this:
Does anybody has already to configure such connection directly in SME with the modem bridged ?? ( no login, no password, fixed IP, unknown gateway IP)
How did you handle it ?
It was something you did back in 2013...I was after instruction that you followed.
https://forums.contribs.org/index.php/topic,49927.msg250224.html#msg250224
cheers
this is OT in this topic and you already posted the same question elsewhere..
-
AFAICS in templates/etc/sysconfig/network-scripts/ifcfg-ethX/10HWADDR fragment, a
config setprop ExternalInterface HWAddress 12:34:56:78:90:ab
followed by proper action/event should be enough (and it is so at least since SME8)
NOTE: edited the key name
WRONG !!!!!!
HWAddress is a totally different purpose : choosing the right network card based on their original MAC Address
MACADDR is to fake the MAC Adress !!!!
-
ops.. I misunderstood.. I apologize
-
ops.. I misunderstood.. I apologize
no problem, It took me also a time to see the difference ;)
plus if you see the syntax of debian it does not help :D to see the difference