make public ip infra
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
f81a4d959c
commit
a4cd5bce4d
4 changed files with 65 additions and 37 deletions
14
lib/vpc.sh
14
lib/vpc.sh
|
|
@ -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}"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue