Last active
October 27, 2021 10:45
-
-
Save arupgsh/0eb07105fba3e74f74442b30460e549b to your computer and use it in GitHub Desktop.
Netplan routing configuration (IPV4) for dual networking interfaces, with one having access to internet other only accessible via local network. This has been tested in Ubuntu server 20.04 and for some reason netplan apply works although netplan try is not working.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Last update 27-10-2021 | |
# network scheme was create using https://netplan.io/reference/ | |
# The following configuration assumes the first interface has internet access | |
# CIDR calculator https://mxtoolbox.com/subnetcalculator.aspx | |
network: | |
ethernets: | |
eno1: | |
addresses: | |
- xxx.xxx.xxx.xxx/24 #IPV4 address for interface 1 | |
routes: | |
- to: default | |
via: xxx.xxx.xxx.xxx #gateway ip for interface 1 | |
metric: 3 | |
routing-policy: | |
- to: 0.0.0.0/0 | |
from: xxx.xxx.xxx.xxx/24 #IPV4 address for interface 1 | |
priority: 100 | |
link-local: [] | |
nameservers: | |
addresses: | |
- 8.8.8.8 | |
- 8.8.4.4 | |
search: [] | |
eno2: | |
addresses: | |
- xxx.xxx.xxx.xxx/24 #IPV4 address for interface 2 | |
routes: | |
- to: default | |
via: xxx.xxx.xxx.xxx #gateway IPV4 address for interface 2 | |
metric: 6 | |
routing-policy: | |
- to: 0.0.0.0/0 | |
from: xxx.xxx.xxx.xxx/24 #IPV4 address for interface 2 | |
priority: 200 | |
link-local: [] | |
nameservers: | |
addresses: | |
- 8.8.8.8 | |
- 8.8.4.4 | |
search: [] | |
version: 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment