fix: enhance bridge creation logic with configuration and interface activation
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 7s
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 7s
This commit is contained in:
@@ -359,13 +359,21 @@ def create_bridge(req: BridgeCreateRequest, ip: IPRoute = Depends(get_iproute)):
|
||||
ip.link("add", ifname=req.name, kind="bridge")
|
||||
br_idx = iface_index(req.name, ip)
|
||||
|
||||
# Interfaces hinzufügen
|
||||
# Bridge konfigurieren
|
||||
# TODO Parameter anpassen (STP, etc.)
|
||||
ip.link("set", index=br_idx, kind="bridge", br_stp_state=0)
|
||||
ip.link("set", index=br_idx, state="up")
|
||||
|
||||
# Interfaces hinzufügen + aktivieren
|
||||
for iface in req.interfaces:
|
||||
idx = iface_index(iface, ip)
|
||||
ip.link("set", index=idx, master=br_idx)
|
||||
|
||||
# Bridge aktivieren
|
||||
ip.link("set", index=br_idx, state="up")
|
||||
# interface hochfahren
|
||||
ip.link("set", index=idx, state="down") # optional - sicherer
|
||||
ip.link("set", index=idx, state="up")
|
||||
|
||||
# interface in die bridge hängen
|
||||
ip.link("set", index=idx, master=br_idx)
|
||||
|
||||
return {
|
||||
"status": "ok",
|
||||
|
||||
Reference in New Issue
Block a user