บันทึกนี้ปรับปรุงล่าสุดเมื่อวันที่ 14-11-2561
ดูแลโดย WIBOON
1. ติดตั้งซอฟต์แวร์ bridge
sudo apt install bridge-utils
2. ตั้งค่า network interface โดยแก้ไขที่ไฟล์ /etc/netplan/01-netcfg.yaml
sudo nano /etc/netplan/01-netcfg.yaml
ตัวอย่าง ตั้ง interface ว่า br0 ให้เป็น IP 192.168.6.19 CIDR subnet /25
# This file describes the network interfaces available on your system # For more information, see netplan(5). network: version: 2 renderer: networkd ethernets: enp0s25: dhcp4: no dhcp6: no bridges: br0: dhcp4: no dhcp6: no interfaces: - enp0s25 addresses: [ 192.168.6.19/25 ] gateway4: 192.168.6.1 nameservers: addresses: - "192.100.77.10"
3. สั่งให้มีผลทันที
sudo netplan apply
4. ตรวจสอบ ifconfig จะได้ผลประมาณนี้
br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.6.19 netmask 255.255.255.128 broadcast 192.168.6.127 enp0s25: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 ether c1:1c:ef:95:89:xx txqueuelen 1000 (Ethernet) lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0