• About Us
  • Contact
  • Trang chủ
  • Code
  • Linux
  • Virtualization
  • Mail
No Result
View All Result
System Zone
No Result
View All Result
Home Linux

Cấu hình IP tĩnh trên ubuntu 20.04

admin by admin
28 Tháng 5, 2022
in Linux
0

Warning: Division by zero in /www/wwwroot/systemzone.top/wp-content/themes/jnews/class/Image/ImageBackgroundLoad.php on line 105
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter

Đầu tiên ta kiểm tra IP hiện tại

Related Posts

Hướng dẫn cài đặt MongoDB 5 trên centos 7

Hướng dẫn resize ổ cứng bằng Gparted trên centos 7

Fix error: kernel: nf_conntrack: table full, dropping packet

Cài đặt CSF trên Directadmin

# ip addr show
Kết quả:
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:15:7c:04:64:b0 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.13/24 brd 192.168.0.255 scope global dynamic eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::215:5dff:fe00:6400/64 scope link
       valid_lft forever preferred_lft forever

IP hiện tại được cấu hình là IP động được cấp từ DHCP của router.

Để đổi thành IP tĩnh, chúng ta cần chỉnh sửa file 00-installer-config.yaml trong thư mục /etc/netplan

# vi /etc/netplan/00-installer-config.yaml

Kết quả hiển thị:
# This is the network config written by 'subiquity'
network:
  ethernets:
    eth0:
       dhcp4: no
       addresses: [103.57.100.20/24]
       gateway4: 103.57.100.254
       nameservers:
             addresses: [8.8.8.8, 8.8.4.4]

  version: 2

Tiến hành thay thế:

addresses : Thay thế bằng địa chỉ IP mong muốn / subnet mask(ở đây /24 tương ứng 255.255.255.0)

gateway4 : Là địa chỉ gateway duy nhất của lớp mạng

addresses nameservers : Đây điền thông tin IP DNS (thường là điền của google, facebook, cloudflare đễ ra mạng).

Sau đó chạy lệnh apply thông số vừa cấu hình:

# sudo netplan apply

Sau khi đã apply xong bạn có thể kiểm tra lại IP xem đã chính xác chưa.

 

Tags: Cấu hình IP tĩnhcấu hình IP tĩnh trên ubuntu 20.04IP tĩnhIP tĩnh ubuntu 20.04ubuntu 20.04
Next Post

Migrate mailbox từ Cpanel sang Cpanel khác

5 1 đánh giá
Đánh giá bài viết
Theo dõi
Đăng nhập
Thông báo của
guest

guest

0 Góp ý
Cũ nhất
Mới nhất Được bỏ phiếu nhiều nhất
Phản hồi nội tuyến
Xem tất cả bình luận

© 2025 SystemZone - Premium WordPress news & magazine theme by Aitemat.

No Result
View All Result
  • About Us
  • About Us
  • blog
  • Campaign
  • Cart
  • Checkout
  • Giới thiệu
  • Home 2
  • IT STORY
  • Lập trình web
  • Learning More
  • Linux Administrator
  • Mail
  • My account
    • Wishlist
  • Privacy Policy
  • Sample Page
  • Track your order
  • Trang chủ
  • Trang Mẫu
  • Virtualization
  • Sections
  • Rows / Columns
  • Sliders
  • Buttons
  • Titles / Dividers
  • Blog Posts
  • Mega Shop
  • Simple Slider
  • Banner Grids
  • Icon Box
  • Lightbox
  • Scroll To
  • Pages
    • About
    • Contact
    • FAQ
    • Portfolio
  • Map
  • Message box
  • Product Categories
  • Products
  • Share / follow icons
  • Tabs
  • Team Member
  • Testimonials

© 2025 SystemZone - Premium WordPress news & magazine theme by Aitemat.

wpDiscuz