- Please Help me to configure internet connection in my ubuntu server.
ArifIT Moderator
How to configure internet connection in Ubuntu server.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our ITSupportBD questions & Answers Engine to ask questions answer people’s questions & connect with other IT people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
How to Configure Static IP Addresses On Ubuntu Server easy way.
Configure Static IP Addresses On Ubuntu Server easy way.
1.Loginto terminal and enter root user like :
sudo -i
2. Goto network config file:
cd /etc/netplan/
3. Tipe ls and you see the config file 50-cloud-init.yaml
4. Edite this confige file :
sudo nano /etc/netplan/50-cloud-init.yaml
Yoy see this file code like :
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init’s network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
enp0s1:
addresses: []
dhcp4: true
version: 2
enp0s1 Is networking port.
You can replace this code :
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init’s network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
ethernets:
enp0s3:
addresses: [192.168.1.2/24]
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8,8.8.4.4]
dhcp4: no
version: 2
Exit and save your changes by running the commands below
sudo netplan apply
Now configured and saved Static IP Addresses On Ubuntu Server.
The most effective method to Configure Static IP Addresses On Ubuntu 20.04 Server simple way.
Setup Static IP address on Ubuntu Server
On Ubuntu 20.04, the framework recognizes network interfaces utilizing ‘unsurprising organization interface names’.
The initial move toward setting up a static IP address is recognizing the name of the ethernet interface you need to design.
To do as such, utilize the ip connect order, as displayed underneath:
To allot a static IP address on the organization interface, open the YAML setup record with your word processor :
sudo nano /etc/netplan/01-netcfg.yaml
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: yes
Prior to changing the arrangement, how about we clarify the code in a short.
Each Netplan Yaml document begins with the organization key that has somewhere around two required components. The initially required component is the adaptation of the organization design, and the subsequent one is the gadget type. The gadget type can be ethernets, bonds, spans, or vlans.
The arrangement above likewise has a line that shows the renderer type. Out of the container, in the event that you introduced Ubuntu in worker mode, the renderer is arranged to utilize networkd as the back end.
Under the gadget’s sort (ethernets), you can determine at least one organization interfaces. In this model, we have just a single interface ens3 that is arranged to get IP tending to from a DHCP worker dhcp4: yes.
Prior to changing the setup, we should clarify the code in a short.
Each Netplan Yaml record begins with the organization key that has something like two required components. The originally required component is the variant of the organization setup design, and the subsequent one is the gadget type. The gadget type can be ethernets, bonds, spans, or vlans.
The setup above additionally has a line that shows the renderer type. Out of the crate, in the event that you introduced Ubuntu in worker mode, the renderer is arranged to utilize networkd as the back end.
Under the gadget’s sort (ethernets), you can indicate at least one organization interfaces. In this model, we have just a single interface ens3 that is designed to get IP tending to from a DHCP worker dhcp4: yes.
To relegate a static IP address to ens3 interface, alter the document as follows:
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: no
addresses:
– 192.168.9.12/24
gateway4: 192.168.9.1
nameservers:
addresses: [8.8.8.8, 8.8.1.1]
When altering Yaml records, ensure you observe the YAML code indent principles. On the off chance that the sentence structure isn’t right, the progressions won’t be applied.
Once done, save the record and apply the progressions by running the accompanying order:
sudo netplan apply
End
We’ve told you the best way to design a static IP address on Ubuntu 20.04.
On the off chance that you have any inquiries, kindly leave a remark underneath.
Add the following lines to the yaml file,