Use setNet to set your MAC address and optionally a static IP address
The dev kit board has an ethernet port, but doesn't have a permanent MAC address. Unless otherwise configured, each time the target boots, a different, locally administered MAC address will be generated. If you're using DHCP, this will likely cause your IP address to change also. If you've set up a static IP address, then the IP address won't change, but switching equipment may encounter errors if an existing IP address is suddenly used by a 'new' ethernet target.
If you're confident editing the /etc/network/interfaces file or have already done so and created some sophisticated up/down rules for eth0, then you probably don't want to use this script as it won't merge its changes nicely.
But if you need a quick, simple way to set up your ethernet, then use setNet.
Either way the old /etc/network/interfaces file is not lost. It's just renamed with a suffix indicating the date and time that setNet was run, which allows you to easily restore the previous version
The simplest use is to call setNet without arguments. This will set the dev board to re-use the MAC it booted with and continue to use DHCP to get its IP address (equivalent to setNet macfixed dhcp ).
If static is given, a fixed mac will be used regardless of whether the macrandom argument is given.
One second after the command completes, eth0 will be reconfigured. If you are logged in over ssh, you'll need to close the session quickly as ssh tends to hang when the far side goes away. There is no problem if you issue the command over a serial connection or if you use ssh like this:
setNet only supports IPv4 addresses at the moment. No checking is done to ensure address, gateway or netmask are valid values. Copyright (C) Sierra Wireless, Inc. 2014. Use of this work is subject to license.