Tuesday, September 18, 2018

Setup Bridge On Ubuntu

Hello Kids,

This time I want to share about Bridge, bridge is like a real bridge that connect two river. In this case we want to connect our virtual machine inside your server into real word as a real connection using your real device like eth0 or eth1.

First you have to install bridge utility
sudo apt-get install bridge-utils

I suggest you to install it on localhost/ local server terminal because you have to disable eth0 network and redirect it to your bridge, so after bridge have been setup you could connect ssh via bridge.

brctl addbr br0

this command to add bridge, you could check your bridge using ip link, these command show your device list

brctl addif br0 eth0

this command to add interface in your bridge, so eth1 bridged to br0. 

edit network config in /etc/networking/interfaces 

auto br0
iface br0 inet dhcp
        bridge_ports eth0
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0
# br1 setup with static wan IPv4 with ISP router as gateway
auto br1
iface br1 inet static
        address 208.43.222.51
        network 255.255.255.248
        netmask 255.255.255.0
        broadcast 208.43.222.55
        gateway 208.43.222.49
        bridge_ports eth1
        bridge_stp off
        bridge_fd 0
        bridge_maxwait 0
and dont forget to restart networking, systemctl restart networking.services

tips : 
you could restart interface using : ip link set dev eth0 up/down equal to ifconfig eth0 down/up

Your Dad,



No comments:

Post a Comment