Answer the question
In order to leave comments, you need to log in
How to set a network card for Internet access in Ubuntu Server?
There is an Ubuntu server. It has two network adapters installed (enp3s0 and enp4s0).
The first is connected to a router with Internet access, the second is connected to a network without Internet access.
What settings to set so that by default the server breaks into the Internet through enp3s0?
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
iface enp3s0 inet static
address 192.168.1.252
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4
auto enp3s0
# The slave network interface
iface enp4s0 inet static
address 10.44.243.252
netmask 255.255.255.240
gateway 10.44.243.254
dns-nameservers 10.44.243.254
auto enp4s0
allow-hotplug enp4s0
Answer the question
In order to leave comments, you need to log in
to make it work:
sudo ip route change default via 192.168.1.1 dev enp3s0
and Remove the
line in the config:
gateway 10.44.243.254
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question