Menambahkan Interface Bridge di Ubuntu
Apa itu interface bridge?
Bridge interface merupakan salah satu interface yang berfungsi sebagai tautan atau penghubung suatu jaringan yang meneruskan lalu lintas atau traffic jaringan berdasarkan tabel alamat mac address (Layer 2). Bridge membangun tabel mac address kemudian mac address mendengarkan traffic jaringan sehingga dapat mengidentifikasi host. Karena kita memakai mac address sehingga perangkat harus terhubung secara langsung melalui physical layer. Saya ambil contoh kita memiliki 1 virtual machine yang dimana default networknya tidak terhubung perangkat apapun, yang artinya vm tersebut tidak memiliki akses internet, kita ingin virtual machine tersebut memiliki akses internet.
Interface Bridge biasa atau sering digunakan pada Komputer Server yang difungsikan untuk Virtualisasi agar VM yang ada pada Server tersebut dapat berhubungan dengan Jaringan Luar melalui Interface Bridge yang dibuat.
Konfigurasi interface brige
Cek interface defaultnya
root@ubuntu:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens160: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:0c:29:54:c7:fe brd ff:ff:ff:ff:ff:ff
inet 10.23.3.114/22 brd 10.23.3.255 scope global dynamic ens160
valid_lft 566sec preferred_lft 566sec
inet6 fe80::20c:29ff:fe54:c7fe/64 scope link
valid_lft forever preferred_lft forever
Install utilitas bridge
root@ubuntu:~# apt install -y bridge-utils
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Suggested packages:
ifupdown
The following NEW packages will be installed:
bridge-utils
0 upgraded, 1 newly installed, 0 to remove and 50 not upgraded.
Need to get 34.4 kB of archives.
After this operation, 121 kB of additional disk space will be used.
Get:1 http://id.archive.ubuntu.com/ubuntu jammy/main amd64 bridge-utils amd64 1.7-1ubuntu3 [34.4 kB]
Fetched 34.4 kB in 0s (238 kB/s)
Selecting previously unselected package bridge-utils.
(Reading database ... 108915 files and directories currently installed.)
Preparing to unpack .../bridge-utils_1.7-1ubuntu3_amd64.deb ...
Unpacking bridge-utils (1.7-1ubuntu3) ...
Setting up bridge-utils (1.7-1ubuntu3) ...
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...
Scanning linux images...
Running kernel seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
Konfigurasi interface bridge dari netplan
root@ubuntu-lab:~# nano /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity' network: ethernets: ens160: dhcp4: true version: 2 bridges: br0: dhcp4: yes interfaces; - ens160
lalu apply menggunakan perintah
netplan applu
Komentar
Posting Komentar