Chia Sẽ Kinh Nghiệm Về IT



Tìm Kiếm Với Google
-


Gởi Ðề Tài Mới  Gửi trả lời
 
Công Cụ Xếp Bài
Tuổi 08-07-2020, 07:35 PM   #1
hoctinhoc
Guest
 
Trả Lời: n/a
Set up your Secondary Network Interface for Ubuntu 18.04
Set up your Secondary Network Interface for Ubuntu 18.04


Đặt 2 range ip trên 2 interface Ubuntu 18


if you are trying to attache the new network interface for your Ubuntu 18.04 EC2 instance, this post might help you to figure out.

  • 1 Summary
  • 2 Solutions
  • 3 Netplan Commands
  • 4 References

Summary

because of Netplan is new network manager in Ubuntu 18.04, things became different as before, and Netplan looks not supported asymmetric routing for now, that is required you to set static ip address & routes for both interfaces.




Solutions

follow above situation
we have to set a default route by on-link option


/etc/netplan/50-primary.yaml




Trích dẫn:


network:
version: 2
renderer: networkd
ethernets:
eth0:
addresses:
- 192.168.0.5/24
dhcp4: no
routes:
- to: 0.0.0.0/0
via: 192.168.0.1 # gateway address
on-link: true
- to: 0.0.0.0/0
via: 192.168.0.1 # gateway address
table: 900
- to: 192.168.0.5
via: 0.0.0.0
scope: link
table: 900 routing-policy:
- from: 192.168.0.5
table: 900 eth1:
addresses:
- 192.168.1.5/24
dhcp4: no
routes:
- to: 0.0.0.0/0
via: 192.168.1.1 # gateway address
on-link: true
- to: 0.0.0.0/0
via: 192.168.1.1 # gateway address
table: 999
- to: 192.168.1.5
via: 0.0.0.0
scope: link
table: 999
routing-policy:
- from: 192.168.1.5
table: 999



to let configurations take effect execute netplan --debug apply
or you can use netplan try, it will setup your configuration with rolling back mechanisms, it will rolling back your last configurations in 120 seconds


Tham khảo: https://www.slll.info/archives/3001.html



  Trả lời ngay kèm theo trích dẫn này
Gửi trả lời


Công Cụ
Xếp Bài

Quyền Hạn Của Bạn
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Mở
Hình Cảm xúc đang Mở
[IMG] đang Mở
Mã HTML đang Tắt




Bây giờ là 10:34 PM. Giờ GMT +7



Diễn đàn tin học QuantriNet
quantrinet.com | quantrimang.co.cc
Founded by Trương Văn Phương | Developed by QuantriNet's members.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.