102Network - amagerard/TemplateVM GitHub Wiki

RedHat10/TemplateVM.

1- Installation 2- Network 3- Firewall 4- Selinux
5- Logs 6- Certificates 7- PassphraseSSH 8- Sudo
9- GnomeShell 10- Volumes 11- Proxmox 12- Troubleshoots

2. Network setup.

2.1 Change the name of the VM.

Modify or create the following files.
vi /etc/hosts

Delete these lines :  
# Loopback entries; do not change.  
# For historical reasons, localhost precedes localhost.localdomain:  
#::1         localhost localhost.localdomain localhost6 localhost6.localdomain6  
# See hosts(5) for proper format and other examples:  
# 192.168.1.10 foo.example.org foo  
# 192.168.1.13 bar.example.org bar  

Add or modify.

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4  
#comment on this line because we are in dhcp.  
#<votre IP>  srv1.local.domain srv1  

vi /etc/hostname

srv1  

vi /etc/sysconfig/network

# Created by anaconda  
networking=yes  
HOSTNAME=srv1.local.domain  

2.2 Rename network interface to eth0 and remove Ipv6.

grubby --args ipv6.disable=1 --update-kernel DEFAULT
grubby --update-kernel=ALL --args=net.ifnames=0
reboot
After the reboot, the eth0 will be down.
The only solution to connect eth0 will be to use the nmcli commands.

2.3 configure eth0 with keyfiles.

2.3.1 Configuration in DHCP mode.

Example: device card ethernet is ens18.
nmcli con show
nmcli con delete ens18
nmcli dev connect eth0
nmcli con mod eth0 ipv6.method disabled
The result of configuration in DHCP mode is in:
more /etc/NetworkManager/system-connections/eth0.nmconnection
This file cannot be edited or deleted.
You have to go through nmcli commands.
ip a

2.3.2 Change in static mode.

This is for your information.
The templateVM is in dhcp.

Example:
IP: 192.168.40.50/24
Gateway: 192.168.40.254
Name Server: 192.168.90.41
Search domain: ol26modk.com
nmcli con mod eth0 ipv4.method "manual" ipv4.addresses 192.168.40.50/24
nmcli con mod eth0 ipv4.gateway 192.168.40.254
nmcli con mod eth0 ipv4.dns 192.168.90.41
nmcli con mod eth0 ipv4.dns-search ol26modk.com
more /etc/NetworkManager/system-connections/eth0.nmconnection
ifconfig eth0 0.0.0.0
systemctl restart NetworkManager
ip a
To return to DHCP mode.
nmcli con delete eth0
nmcli dev connect eth0
nmcli con mod eth0 ipv6.method disabled
more /etc/NetworkManager/system-connections/eth0.nmconnection
ip a

⚠️ **GitHub.com Fallback** ⚠️