Permanent network settings
8,656
Add the following to the configuration file at /etc/network/interfaces
or create a new file in /etc/network/interfaces.d/
called eth1
auto eth1
iface eth1 inet static
address 10.10.0.2
netmask 255.255.255.0
gateway 10.10.0.100
Debian Wiki - Network configuration is a great place to read and understand how to write network configurations
Related videos on Youtube
Author by
Sebastian Busek
Updated on September 18, 2022Comments
-
Sebastian Busek over 1 year
In my (virtual) Ubuntu server I'm using two network interfaces, cmd
ls /sys/class/net/
returnseth0 eth1 lo
but
eth1
isn't enabled at startup and I have to manually setup, usually I'm using commandssudo ifconfig eth1 10.10.0.2 netmask 255.255.255.0 sudo route add default gw 10.10.0.100 eth1 sudo ifconfig eth1 up
My question is: how can I save configuration for
eth1
?cat /etc/network/interfaces
:source /etc/network/interfaces.d/* auto lo iface lo inet loopback auto eth0 iface eth0 inet dhcp iface eth0 inet6 auto
-
TheOdd over 7 yearsIf all else fails, you could add a startup script that runs those commands.
-
steeldriver over 7 yearsPlease edit your question to include the contents of the
/etc/network/interfaces
file
-