How to configure ethernet interface

Revision as of 10:04, 3 May 2019 by Registered User

Template:ArticleMainWriter Template:ArticleApprovedVersion


1. Purpose[edit source]

This article describes how to configure the Ethernet interface.

2. With Ifconfig tools[edit source]

  • Connect an Ethernet cable and enjoy

At startup SSH daemon (sshd) and ifplugd daemon are automatically launched:

  • sshd (useful to perform ssh, scp)
  • ifplugd detect:
    • udhcpc is launched on cable detection to retrieve an IP address,

If a DHCP server is not available, one can set the Ethernet IP adress with :

  ifconfig eth0 uuu.xxx.yyy.zzz
Warning white.png Warning
If there is some service like systemd-networkd, NetworkManager, Connman the configuration of ethernet interface can change when the service see the change


To check if eth0 and the gateway are well configured, one can type:
 ifconfig
 route
In the console, a log similar to the one below should be displayed:
  ifconfig
 eth0      Link encap:Ethernet  HWaddr 00:80:E1:01:39:61  
           inet addr:10.48.1.172  Bcast:10.48.3.255  Mask:255.255.252.0
           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
           RX packets:18 errors:0 dropped:0 overruns:0 frame:0
           TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000 
           RX bytes:3038 (2.9 KiB)  TX bytes:684 (684.0 B)
           Interrupt:103 
 STM32MP1 # route
 Kernel IP routing table
 Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
 default         lme-gw-vl802.lm 0.0.0.0         UG    10     0        0 eth0
 10.48.0.0       *               255.255.252.0   U     0      0        0 eth0

3. With systemd-networkd[edit source]

Systemd-networkd is a network service provided by systemd.

3.1. Configure a dynamic ip on specific ethernet interface[edit source]

Systemd-networkd provide a directory on which the ethernet interface must be configured via configuration file.

  ls /lib/systemd/network
50-wired.network            52-static.network.static    80-container-vz.network
50-wired.network.static     80-container-host0.network  99-default.link 
51-wireless.network.sample  80-container-ve.network

ST


4. References[edit source]