Find code and diagrams at:

Configuring Networking at the command line in Linux can be confusing. It’s important to know that you use many different application to manage networking and these applications may be different based on your distribution or version.

ifconfig – See IP address and Network Interface ID (deprecated, but works)

ip addr – See IP address and Network Interface ID

route -n – view default gateway

systemd-resolve –status – view DNS

sudo dhclient -v -r – DHCP release

sudo dhclient -v – DHCP renew

Set Static IP Address

Navigate to: /etc/netplan/
sudo vim file.yaml – edit thye file that ends in yaml
network:
version: 2
renderer: networkd
ethernets:
ens3:
dhcp4: no
addresses:
– 192.168.121.199/24
gateway4: 192.168.121.1
nameservers:
addresses: [8.8.8.8, 1.1.1.1]
sudo netplan apply – apply network changes

Nguồn: https://codeigniterbrasil.com

Xem thêm bài viết khác: https://codeigniterbrasil.com/lap-trinh-linux/

22 Comments

Kiran Thapa

May 12, 2020

I cannot set static IP as it says invalid inconsistent indentation Version 2 or ethernets once changed

Reply

ninad jadhav

May 12, 2020

I am trying to set up NAT on Ubuntu 18.04. So, can you please tell me the list of configuration files I need to change, and is the Ubuntu18.04 NAT configuration process different than Ubuntu16.0X?

Reply

asim abu sallam

May 12, 2020

thanks u help us a lot

Reply

Guilherme Ribeiro de Bonis

May 12, 2020

Hey Eli, I would like to make and professional like network for IoT at home, do you have and tutorial? Now a days with so much devices, I would like to protect my self. I have the ISP one extra router and 2 PCs, 1 NAS, notebook and 6 devices. Thanks in advance

Reply

Stephan C

May 12, 2020

Need more of these

Reply

Sebastiaan van den Akker

May 12, 2020

Great intro to Linux vid series, Mr. Eli! Enjoyed it very much, and hopefully some things wil retain…

Reply

Jake Snake

May 12, 2020

Nice video

Reply

Eli In the Wolverine State

May 12, 2020

What a pain. Recently had to learn more than I wanted to about networking. Got the add hoc network with VPN adblocker and hotspot going.

Reply

Nonso Coinbase

May 12, 2020

Great content! Thanks a million times. Keep up the good work. Again, thanks.

Reply

crystal sluka

May 12, 2020

that wasn't hard to understand eli lol

Reply

Weezy Breezy

May 12, 2020

🙏🙌👏Thanks for this video. 👍

Reply

N3l!y

May 12, 2020

Does Eli have a discord?

Reply

Rue U

May 12, 2020

Id look forward if you ever make more in-depth videos on the following (as i find them complicated and too lazy to go thoroughly rtfm)

Systemd – big ecosystem. I know that that would be several part videos…so maybe not
ip – complicated syntax
route – (this is easy but somehow i always fail to manually add routes for at lewast 30 mins 😂)

Reply

Rue U

May 12, 2020

ifconfig will always br used as long as its syntax is easier than ip

Reply

Mikke Nieminen

May 12, 2020

Thanks

Reply

Luca Drogon

May 12, 2020

Thanks.

Reply

Dimitris Tsoutsouras

May 12, 2020

…in mine (also ubunt serb 18.04) it also has optional: true and below that a line version: 2

What does those two lines refer to?

Reply

Elisa V2

May 12, 2020

Why the 10.0.1.14 address is a class C? I know that based on its mask is a class C, but is not supposed to be used on Class A? btw, good video 🙂

Reply

Mansour Q

May 12, 2020

Thank you so much for great video, keep up your great work THUMBS up 👍

Reply

Michael Mitchell

May 12, 2020

Needs me an iptables video.

Reply

Ashley Montgomery

May 12, 2020

Thank you!!!

Reply

Mr. Tech Guy

May 12, 2020

Another wonderful and useful tutorial…

💯💯💯

Reply

Leave a Reply