How to assign static IP address and bridging for ubuntu server

 Edit your interfaces

sudo nano /etc/network/interfaces

 Enter your IP address information

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.1.3
gateway 192.168.1.1
netmask 255.255.255.0
dns-nameservers 8.8.8.8 8.8.4.4

Restart network interface and services

sudo ifdown eth0 && sudo ifup eth0
sudo /etc/init.d/networking restart

sudo service network-manager restart
sudo service networking restart
sudo service resolvconf restart

Bridging

auto br0
iface br0 inet static
address 192.168.0.10
network 192.168.0.0
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1

bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off

Verify your new IP Address

route
ip route
hostname -I

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top