Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Private IP addresshttps://linuxhandbook.com/find-ip-address/

hostname -I

nmcli -p device show


Public IP addresshttps://www.tutorialspoint.com/find-my-public-ip-address-from-linux-command-line


Centos config file
dhcp

sudo more /etc/sysconfig/network-scripts/ifcfg-ens18


Code Block
titledhcp
sudo vi /etc/sysconfig/network-scripts/ifcfg-ens18

BOOTPROTO=dhcp
DEFROUTE=yes
DEVICE=ens18
DHCPV6C=no
MTU=1500
NM_CONTROLLED=yes
ONBOOT=yes
PEERDNS=yes
TYPE=Ethernet
USERCTL=no


static

sudo more /etc/sysconfig/network-scripts/ifcfg-ens18


Code Block
titlestatic IP address
sudo vi /etc/sysconfig/network-scripts/ifcfg-ens18




UbuntuConfig file

netpla
renderer: networkd

renderer: NetworkManager
( not installed by default )
networkd
netplan
vi /etc/netplan/xx--installer-config.yaml
!!! all the files in the list will be used
osboxes@osboxes:/etc/netplan$ more
sudo netplan apply
sudo netplan get   ( get the config information )


Code Block
titlenetplan config file YAML
collapsetrue
more /etc/netplan/10-installer-config.yaml


# This is the network config written by 'subiquity'


network:

ethernets:
ens33:

  version: 2
  renderer: networkd
  ethernets:
    ens33:
      dhcp4: true


    ens34:


      dhcp4: 
true
version: 2
sudo netplan applysudo netplan get   ( get the config information )
ip addr
no
      addresses: [10.1.4.10/24]
      gateway4: 10.1.4.2


Network Manager

DHCP
/etc/network/interfaces
auto eth1
  iface eth1 inet dhcp

sudo systemctl restart networking
Static




...