How to bridge two interfaces with netplan
5,451
Sample of two interfaces :
ethernets:
eth0:
addresses:
- 192.168.2.2/24
routes:
- to: 0.0.0.0/0
via: 192.168.2.1
metric: 100
table: 101
routing-policy:
- from: 192.168.2.0/24
table: 101
eth1:
addresses:
- 192.168.22.2/24
gateway4: 192.168.22.1
nameservers:
addresses: [192.168.22.1]
Related videos on Youtube
Author by
Amir Dallal
Updated on September 18, 2022Comments
-
Amir Dallal over 1 year
I want to setup a gateway on an Ubuntu 18.04 machine with 2 eth ports - ETH1 - WAN connection, connected to my corporate network with DHCP ETH0 - LAN connection, connected to my laptop statically
I need to use netplan.
Please assist with sample configuration. thank you!
-
Doug Smythies over 5 yearsdoes this help?
-
Amir Dallal over 5 yearsThanks Doug. I am just not sure how to route my LAN traffic thru my WAN interface. What are the routing rules and iptables, and how do I configure it using netplan? Thanks again!
-
Doug Smythies over 5 yearsI don't know that any special routing rules are required, I don't have any. A simple router iptables rules set (no firewall stuff) example is here.
-