summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2022-12-19 16:32:24 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2022-12-19 16:32:24 +0000
commit34edb6c19fd77af3ec621905e45631e4901ef574 (patch)
tree64a1b4c09cca1274ee65050e9d1314fc55b9e4aa /src
parentd9ab07c3d7d988706cbdfc4fac16f7e2ca264f72 (diff)
downloadvyos-1x-34edb6c19fd77af3ec621905e45631e4901ef574.tar.gz
vyos-1x-34edb6c19fd77af3ec621905e45631e4901ef574.zip
T4879: IPsec migration script remote-id for peer name eq address
Migration for "remote-id" where peer is IPv4 or IPv6 address was missed It was only migration if peer starts with "@" It cause that you must manualy set 'remote-id' to get it working correctly replace 'vpn ipsec site-to-site peer 192.0.2.2' => 'vpn ipsec site-to-site peer peer_192-0-2-2 authentication remote-id 192.0.2.2'
Diffstat (limited to 'src')
-rwxr-xr-xsrc/migration-scripts/ipsec/9-to-108
1 files changed, 4 insertions, 4 deletions
diff --git a/src/migration-scripts/ipsec/9-to-10 b/src/migration-scripts/ipsec/9-to-10
index 1254104cb..de366ef3b 100755
--- a/src/migration-scripts/ipsec/9-to-10
+++ b/src/migration-scripts/ipsec/9-to-10
@@ -85,10 +85,10 @@ if config.exists(base + ['site-to-site', 'peer']):
config.rename(peer_base + ['authentication', 'id'], 'local-id')
# For the peer '@foo' set remote-id 'foo' if remote-id is not defined
- if peer.startswith('@'):
- if not config.exists(peer_base + ['authentication', 'remote-id']):
- tmp = peer.replace('@', '')
- config.set(peer_base + ['authentication', 'remote-id'], value=tmp)
+ # For the peer '192.0.2.1' set remote-id '192.0.2.1' if remote-id is not defined
+ if not config.exists(peer_base + ['authentication', 'remote-id']):
+ tmp = peer.replace('@', '') if peer.startswith('@') else peer
+ config.set(peer_base + ['authentication', 'remote-id'], value=tmp)
# replace: 'peer <tag> force-encapsulation enable'
# => 'peer <tag> force-udp-encapsulation'