Create bridge

ip link add name br0 type bridge
ip link set br0 up

Add Network Interfaces to the bridge

ip link set eth0 master br0
ip link set eth1 master br0

Create a namespace

ip netns add ns0

Exec to namespace

ip netns exec ns0 bash
# Now we are inside namespace
# ~ Hit: ip link; You will see only one loop back interface

List all interface

# Think interface as link door which enables us to connect outside
ip link

Create an interface

# A veth (virtual Ethernet) pair is a pair of virtual network interfaces.
# pair1 --- pair1e
ip link add pair1 type veth peer name pair1e

# Make sure UP the pair
ip link set pair1 up
ip link set pair1e up

Move one pair outside of the namespace

# Whenever we are running this command make sure
# we are within the namespace
# we want pair1 should be go outside
# `1` represent host namespace
ip link set pair1 netns 1