Sunday, March 9, 2014

Embedded Networking

Nowadays everything and anything are connected using Internet Protocols: TCP, UDP, RTP, ARP, IGMP... the list goes on and on.  However, embedded systems are frequently island systems, that are not connected to the usual support services such as DHCP and DNS.  IP addresses are static and there are no gateways to other nets.

Island Networks

When you plug an office laptop computer into a typical embedded net, nothing happens, your machine remains unconfigured and you cannot access anything. Testing and debugging a modern system therefore requires a little bit of advanced networking knowledge.

In order to communicate on a net, your machine needs at least two things to be configured: IP Address and Subnet Mask, but before you can set it, you first have to disable the NetworkManager auto-configuration utility, since in an embedded system, it is more of a hindrance than a help.

Each time you unplug a cable or power down the device your laptop computer is connected to, Network Manager tends to forget the IP settings and when you replug it, you got to set everything up all over again.  This gets annoying super quick.

Network Manager

To save your sanity, disable NetworkManager with one of these commands:
# service NetworkManager stop

# systemctl stop NetworkManager.service
# systemctl disable NetworkManager.service

# killall NetworkManager

Network Settings

Once NetworkManager is truly dead, see what the available network devices are:
# ifconfig

# ip link show

Now you can set a static address and be assured that it will stick:
# ifconfig em1 netmask up

# ip addr add dev em1
# ip link set em1 up

There Is More Than One Way To Do It (TIMTOWDI).

Going back to Normal

When you need to check you email or do a search for information and you need to plug the machine back into a wall socket, you got to restart the network, or just restart Network Manager.

# systemctl restart network.service

# systemctl restart NetworkManager.service

Happy debugging!

No comments:

Post a Comment

On topic comments are welcome. Junk will be deleted.