Skip to content

Commit b6401e8

Browse files
authored
vsrx: Add transparent management interface mode compatibility (#288)
1 parent a2638e4 commit b6401e8

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

vsrx/docker/init.conf

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ interfaces {
2525
fxp0 {
2626
unit 0 {
2727
family inet {
28-
address 10.0.0.15/24;
28+
address {MGMT_IP_IPV4};
29+
}
30+
family inet6 {
31+
address {MGMT_IP_IPV6};
2932
}
3033
}
3134
}
@@ -34,7 +37,12 @@ routing-instances {
3437
mgmt_junos {
3538
routing-options {
3639
static {
37-
route 0.0.0.0/0 next-hop 10.0.0.2;
40+
route 0.0.0.0/0 next-hop {MGMT_GW_IPV4};
41+
}
42+
rib mgmt_junos.inet6.0 {
43+
static {
44+
route ::/0 next-hop {MGMT_GW_IPV6};
45+
}
3846
}
3947
}
4048
}

vsrx/docker/launch.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def __init__(self, hostname, username, password, conn_mode):
5252
driveif="virtio",
5353
cpu="SandyBridge,vme=on,ss=on,vmx=on,f16c=on,rdrand=on,hypervisor=on,arat=on,tsc-adjust=on,umip=on,arch-capabilities=on,pdpe1gb=on,skip-l1dfl-vmentry=on,pschange-mc-no=on,bmi1=off,avx2=off,bmi2=off,erms=off,invpcid=off,rdseed=off,adx=off,smap=off,xsaveopt=off,abm=off,svm=on,aes=on",
5454
smp="2,sockets=1,cores=2,threads=1",
55+
mgmt_passthrough=False,
5556
)
5657
self.nic_type = "virtio-net-pci"
5758
self.conn_mode = conn_mode
@@ -61,10 +62,14 @@ def __init__(self, hostname, username, password, conn_mode):
6162
with open("init.conf", "r") as file:
6263
cfg = file.read()
6364

64-
new_cfg = cfg.replace("{HOSTNAME}", hostname)
65+
cfg = cfg.replace("{MGMT_IP_IPV4}", self.mgmt_address_ipv4)
66+
cfg = cfg.replace("{MGMT_GW_IPV4}", self.mgmt_gw_ipv4)
67+
cfg = cfg.replace("{MGMT_IP_IPV6}", self.mgmt_address_ipv6)
68+
cfg = cfg.replace("{MGMT_GW_IPV6}", self.mgmt_gw_ipv6)
69+
cfg = cfg.replace("{HOSTNAME}", self.hostname)
6570

6671
with open("init.conf", "w") as file:
67-
cfg = file.write(new_cfg)
72+
cfg = file.write(cfg)
6873

6974
self.startup_config()
7075

0 commit comments

Comments
 (0)