Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng

Quản trị net diễn đàn chia sẻ thông tin các thủ thuật mạng, internet bảo mật thông tin dành cho giới IT VIệt hy vọng là nơi bổ ích cho cộng đồng (http://quantrinet.com/forum/index.php)
-   Linux và các thủ thực nhỏ (http://quantrinet.com/forum/forumdisplay.php?f=430)
-   -   Set up your Secondary Network Interface for Ubuntu 18.04 (http://quantrinet.com/forum/showthread.php?t=10221)

hoctinhoc 08-07-2020 07:35 PM

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.
https://i.imgur.com/0tFcoZo.png


https://i.imgur.com/0tFcoZo.png
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



:battay:


Bây giờ là 04:05 AM. 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.