Etcnet start: Difference between revisions

From ALT Linux Wiki
(Created page with "===Network setup=== On the servers, instead Network Manager, more comfortably use Etcnet. For add it to system, need to install package '''etcnet-full''': # apt-get install...")
 
No edit summary
 
Line 72: Line 72:
in our example:
in our example:
  systemctl enable network@eth0
  systemctl enable network@eth0
[[ru:Etcnet start]]

Latest revision as of 23:38, 2 July 2024

Network setup

On the servers, instead Network Manager, more comfortably use Etcnet.

For add it to system, need to install package etcnet-full:

# apt-get install etcnet-full

For discover, which network interfaces are present in you system, enter:

# ip a

When you defined, what in your system, for example, one network card eth0, go to /etc/net/ifaces/eth0.

cd /etc/net/ifaces/eth0

If this folder are missing, then go to /etc/net/ifaces/ and create it.

cd /etc/net/ifaces/
mkdir eth0
cd eth0

Edit options:

nano options

For DHCP:

TYPE=eth
DISABLED=no
NM_CONTROLLED=no
BOOTPROTO=dhcp

For Static:

TYPE=eth
DISABLED=no
NM_CONTROLLED=no
CONFIG_IPV4=YES

Edit IPv4-options:

nano ipv4address
192.168.0.5/24

Edit gateway-options:

nano ipv4route
default via 192.168.0.15

Default domains and DNS-servers:

nano resolv.conf
search mydom1.local domain2.ru
nameserver 8.8.8.8 192.168.0.5

Restarting network:

service network restart

Disable NetworkManager:

service NetworkManager stop
service NetworkManager disable

Enable service autostart:

service network enable

Run ifconfig, ping - we are have acess to network, ping goes!

$ ifconfig
$ ping 8.8.8.8

If you use Systemd

Then:

  • to file options of customizable interface need add:
ONBOOT=no
  • enable his autostart via systemd:
systemctl enable network@<interface name>

in our example:

systemctl enable network@eth0