Open main menu

DAVE Developer's Wiki β

Changes

How to configure the network interfaces

735 bytes removed, 09:51, 15 February 2023
no edit summary
{{InfoBoxTop}}
{{AppliesToAxel}}
{{AppliesToAxelLite}}
{{AppliesToAxelEsatta}}
{{Applies To Bora}}
{{Applies To BoraX}}
{{Applies To BoraLite}}
{{Applies To Diva}}
{{InfoBoxBottom}}
 
 
== How to configure the network interfaces ==
* IP address of the device '''192.168.1.100'''
=== SysV systemd ===
The network configuration files for SysV can be systemd are basically found in pre-defined directorys as written [https:the <code>/etc/en.wikibooks.orgsystemd/wikinetwork/Linux_Networking</Where_should_I_put_the_configuration_commands%3F here]code> directory.
Basically, The most simply way for configuring the network configuration, it should be enough interface is to properly configure create/edit the <code>file '''/etc/systemd/network/interfaces<20-eth0.network''' as per the following paragraphs. In the event that there are another network interface, then this must be create/code> file.  # edit as '''/etc/systemd/network/interfaces 20-- configuration file for ifup(8), ifdown(8)eth1.network'''. Here below an For more example of configuration fileand usage hints on systemd, please refer to our [[XELK-AN-008:_How_to_use_systemd_on_an_Embedded_system#Configuring_the_network_interfaces | wiki]] page.
==== Static IP address ====
The SBC ORCA has two network interface interfaces, below is configured with shown how to configure them both through a static IP address by creating . In the configuration entry in the '''/etc/network/interfaces''' file as the following:case of SBCX MINI there is only one ethernet interface, consequently going to configure only eth0 interface.
Example for ethernet interface 0.
<pre>
auto eth0[Match]iface Name=eth0 inet static address 192.168.1.100 netmask 255.255.255.0 gateway 192.168.1.254</pre>
# Prevent the interface loading if the kernel boots from nfsKernelCommandLine==== Dynamic IP addres (DHCP) ====!nfsroot
The network interface is configured - using a proper DHCP server on the network - by creating the configuration entry in the '''/etc/network/interfaces''' file as the following:[Network]Address=192.168.1.100<pre>Gateway=192.168.1.254allow-hotplug eth0iface eth0 inet dhcpDNS=192.168.1.1
</pre>
When the Linux kernel detects the physical Example for ethernet interface eth0, the iface causes ''ifup'' to use DHCP to configure the interface. ==== DNS ==== If the <code>resolvconf</code> package is not installed, the DNS configuration can be done manually by editing the '''/etc/resolv1.conf''' as the following: 
<pre>
nameserver 192.168.1.1[Match]</pre>Name=eth1
For example, it can be done on # Prevent the command line echoing interface loading if the string in this way:kernel boots from nfsKernelCommandLine=!nfsroot
root@axel-lite:~# echo "nameserver [Network]Address=192.168.1.101Gateway=192.168.1" > /etc/resolv.conf254DNS==== loopback network interface ==== The following configuration entry in the '''/etc/network/interfaces''' file brings up the loopback network interface lo upon booting the system192.168.1.<pre># The loopback interfaceauto loiface lo inet loopback1
</pre>
This one always exists in Once modified, the ''<code>networkd</etc/network/interfaces'' file.code> service should be resarted:
=== systemctl restart systemd ===-networkd
The network configuration for systemd are basically found in the <code>/etc/systemd/network/</code> directory.==== Dynamic IP addres (DHCP) ====
The most simply way for configuring the SBC ORCA has two network interface interfaces, below is shown how to create/edit configure them both through DHCP. In the file '''/etc/systemd/network/case of SBCX MINI there is only one ethernet interface, consequently going to configure only eth0.network''' as per the following paragraphsinterface.
For more example and usage hints The network interface is configured - using a proper DHCP server on systemd, please refer to our [[XELK-ANthe network -008by using the '''DHCP''' key in the configuration file as the following:_How_to_use_systemd_on_an_Embedded_system#Configuring_the_network_interfaces | wiki]] page. ==== Static IP address ====
<pre>
[Network]
AddressDHCP=192.168.1.100Gateway=192.168.1.254DNS=192.168.1.1yes
</pre>
==== Dynamic IP addres (DHCP) ==== The In the event that there are another network interface is configured - using a proper DHCP server on the network - by using the '''DHCP''' key in , the configuration file as the following:
<pre>
[Match]
Name=eth0eth1
# Prevent the interface loading if the kernel boots from nfs
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
 
Once modified, the <code>resolved</code> service should be resarted:
 
systemctl restart systemd-resolved
==== loopback network interface ====
==== Apply configuration changes ====
After editing the above files, changes are applied after reboot or by restarting <code>systemd-networkd.service</code>:<syntaxhighlight lang="bash">
root@imx6qdlxelkdesk-mx8mp:~# systemctl restart systemd-networkd.service
</syntaxhighlight>
dave_user
404
edits