config file for second network device

Issues related to configuring your network
Post Reply
silentbirdie
Posts: 1
Joined: 2020/09/13 20:57:57

config file for second network device

Post by silentbirdie » 2020/09/13 21:03:27

ok so i have a virtual machine set up for a school assignement where i need to allow forwarding using iptables. the only issue i am having is whenever i try to have a second network interface there is never a second config file in /etc/sysconfig/network-scripts/ my first card that was setup automatically on install has the file ifcfg-ens33, my second network card doesn't have a file called ifcfg-ens37 to configure it. how to i get my operating system to create this file or how to i create it so the system uses the file and load up the settings? I can do it via gui but would like to kow how to do it via command line for future reference.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: config file for second network device

Post by TrevorH » 2020/09/13 22:00:22

One way is to copy the existing one and edit it, changing MAC address, and mentions of one device name to the other.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4530
Joined: 2007/12/11 08:17:33
Location: Finland

Re: config file for second network device

Post by jlehtone » 2020/09/14 06:49:00

silentbirdie wrote:
2020/09/13 21:03:27
I can do it via gui but would like to kow how to do it via command line for future reference.
CentOS 7 has two services that can configure network settings: NetworkManager.service and network.service.
Only one of them can manage any given interface/connection and it is usually better, if only one service is enabled.
NetworkManager.service is the default. Its command line tool is nmcli.

Code: Select all

man nmcli
man nmcli-examples
One does not "edit a file" for NetworkManager. One uses NM tools (GUI applet, nmtui, nmcli) that modify files for you.

Post Reply