Lập Trình Linux

Linux – Network Configuration (ip, route, dhclient, systemd-resolve, netplan)




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://ftlinuxcourse.com

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

Tin HOT
Vì sao Vua Bảo Đại chỉ cưới 1 vợ: Hoàng hậu Nam Phương?
Công Nghệ
Tạo danh sách thả xuống để lựa chọn dữ liệu nhập trong Excel
Lập Trình Linux
→ Chuyển đổi thao tác Giao diện sang Dòng lệnh
  • I cannot set static IP as it says invalid inconsistent indentation Version 2 or ethernets once changed


  • 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?


  • thanks u help us a lot


  • 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


  • Need more of these


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


  • Nice video


  • 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.


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


  • that wasn't hard to understand eli lol


  • 🙏🙌👏Thanks for this video. 👍


  • N3l!yN3l!y

    Author Reply

    Does Eli have a discord?


  • Rue URue U

    Author Reply

    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 😂)


  • Rue URue U

    Author Reply

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


  • Thanks


  • Thanks.


  • …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?


  • 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 🙂


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


  • Needs me an iptables video.


  • Thank you!!!


  • Another wonderful and useful tutorial…

    💯💯💯