make public ip infra

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2025-05-19 18:47:13 +02:00
commit a4cd5bce4d
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
4 changed files with 65 additions and 37 deletions

View file

@ -27,6 +27,20 @@ function create_vpc {
{
add_in_db "vpc" "${vpc_name}"
create_netns "${vpc_name}"
ip link add "${vpc_name}-ext" type veth peer name "veth-public-int" netns "${vpc_name}"
ip netns exec "${vpc_name}" brctl addbr "br-public"
ip netns exec "${vpc_name}" brctl stp "br-public" off
brctl addif "br-public" "${vpc_name}-ext"
ip netns exec "${vpc_name}" brctl addif "br-public" "veth-public-int"
ip link set up dev "${vpc_name}-ext"
ip -n "${vpc_name}" link set up dev "veth-public-int"
ip -n "${vpc_name}" link set up dev "br-public"
print_in_color "${COLOR_GREEN}" "Create ${vpc_name}"
}