2022-12-07 23:52:49 +00:00
|
|
|
OsmoUPF> enable
|
|
|
|
OsmoUPF# configure terminal
|
|
|
|
OsmoUPF(config)# tunmap
|
|
|
|
|
2022-12-06 17:05:27 +00:00
|
|
|
OsmoUPF(config-tunmap)# show nft-rule tunmap example
|
2023-02-03 01:05:05 +00:00
|
|
|
% init verdict map:
|
2023-02-03 02:32:05 +00:00
|
|
|
add table inet osmo-upf { flags owner; };
|
2023-02-03 01:05:05 +00:00
|
|
|
|
|
|
|
add chain inet osmo-upf pre { type filter hook prerouting priority -300; policy accept; };
|
|
|
|
add chain inet osmo-upf post { type filter hook postrouting priority 400; policy accept; };
|
|
|
|
add map inet osmo-upf tunmap-pre { typeof ip daddr . @ih,32,32 : verdict; };
|
|
|
|
add map inet osmo-upf tunmap-post { typeof meta mark : verdict; };
|
|
|
|
add rule inet osmo-upf pre udp dport 2152 ip daddr . @ih,32,32 vmap @tunmap-pre;
|
|
|
|
add rule inet osmo-upf post meta mark vmap @tunmap-post;
|
|
|
|
|
|
|
|
% add tunmap:
|
|
|
|
% ACCESS 1.1.1.1:0x102 <---> 2.2.2.1:0x201 UPF 2.2.2.3:0x203 <---> 3.3.3.3:0x302 CORE
|
|
|
|
add chain inet osmo-upf tunmap-pre-123;
|
|
|
|
add rule inet osmo-upf tunmap-pre-123 ip daddr set 3.3.3.3 meta mark set 123 counter accept;
|
|
|
|
add chain inet osmo-upf tunmap-post-123;
|
2024-05-08 14:35:39 +00:00
|
|
|
add rule inet osmo-upf tunmap-post-123 ip saddr set 2.2.2.3 udp sport set 2152 @ih,32,32 set 0x302 counter accept;
|
2023-02-03 01:05:05 +00:00
|
|
|
add element inet osmo-upf tunmap-pre { 2.2.2.1 . 0x201 : jump tunmap-pre-123 };
|
|
|
|
add element inet osmo-upf tunmap-post { 123 : jump tunmap-post-123 };
|
|
|
|
add chain inet osmo-upf tunmap-pre-321;
|
|
|
|
add rule inet osmo-upf tunmap-pre-321 ip daddr set 1.1.1.1 meta mark set 321 counter accept;
|
|
|
|
add chain inet osmo-upf tunmap-post-321;
|
2024-05-08 14:35:39 +00:00
|
|
|
add rule inet osmo-upf tunmap-post-321 ip saddr set 2.2.2.1 udp sport set 2152 @ih,32,32 set 0x102 counter accept;
|
2023-02-03 01:05:05 +00:00
|
|
|
add element inet osmo-upf tunmap-pre { 2.2.2.3 . 0x203 : jump tunmap-pre-321 };
|
|
|
|
add element inet osmo-upf tunmap-post { 321 : jump tunmap-post-321 };
|
|
|
|
|
|
|
|
% delete tunmap:
|
|
|
|
delete element inet osmo-upf tunmap-pre { 2.2.2.1 . 0x201 };
|
|
|
|
delete element inet osmo-upf tunmap-post { 123 };
|
|
|
|
delete chain inet osmo-upf tunmap-pre-123;
|
|
|
|
delete chain inet osmo-upf tunmap-post-123;
|
|
|
|
delete element inet osmo-upf tunmap-pre { 2.2.2.3 . 0x203 };
|
|
|
|
delete element inet osmo-upf tunmap-post { 321 };
|
|
|
|
delete chain inet osmo-upf tunmap-pre-321;
|
|
|
|
delete chain inet osmo-upf tunmap-post-321;
|
2022-12-06 17:05:27 +00:00
|
|
|
|
|
|
|
OsmoUPF(config-tunmap)# show nft-rule tunmap append
|
2023-02-03 01:15:36 +00:00
|
|
|
% deprecated config option: 'show nft-rule tunmap append'
|
|
|
|
OsmoUPF(config-tunmap)# nft-rule tunmap append meta nftrace set 1
|
|
|
|
% deprecated config option: 'nft-rule tunmap append'
|
2022-12-06 17:05:27 +00:00
|
|
|
OsmoUPF(config-tunmap)# no nft-rule tunmap append
|
2023-02-03 01:15:36 +00:00
|
|
|
% deprecated config option: 'no nft-rule tunmap append'
|