networking

network namespaces netns

preparation

ufw disable

create namespapce

ip netns add red
ip netns add blue

veth

ip link add veth-red type veth peer name veth-blue
ip link set veth-red netns red
ip link set veth-blue netns blue
ip -n red addr add 192.168.15.1 dev veth-red
ip -n blue addr add 192.168.15.2 dev veth-blue
ip -n red link set veth-red up
ip -n blue link set veth-blue up
 
# delete
ip -n  red link del veth-red
 
# show unattached veth
ip -c link show type veth

bride