Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-UPF
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenXG
OpenXG-UPF
Commits
de7932b1
Commit
de7932b1
authored
Apr 01, 2022
by
kharade
Committed by
thhung
Apr 01, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upf n9 support
parent
265d99ea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
36 deletions
+54
-36
scripts/entrypoint.sh
scripts/entrypoint.sh
+29
-13
scripts/upf_conf/init.conf
scripts/upf_conf/init.conf
+16
-15
scripts/upf_conf/upf_profile.json
scripts/upf_conf/upf_profile.json
+9
-8
No files found.
scripts/entrypoint.sh
View file @
de7932b1
...
...
@@ -41,25 +41,41 @@ set -euo pipefail
CONFIG_DIR
=
"/openair-upf/etc"
BIN_DIR
=
"/openair-upf/bin"
INGRESS_INTERFACE
=
n3
INGRESS_INT
=
N3
EGRESS_INTERFACE
=
n6
EGRESS_INT
=
N6
UPF_TYPE
=
${
UPF_TYPE
:-
none
}
if
[[
${
UPF_TYPE
}
==
"A-UPF"
]]
;
then
INGRESS_INTERFACE
=
n9
INGRESS_INT
=
N9
fi
if
[[
${
UPF_TYPE
}
==
"I-UPF"
]]
;
then
EGRESS_INTERFACE
=
n9
EGRESS_INT
=
N9
fi
UUID
=
$(
cat
/proc/sys/kernel/random/uuid
)
SGI
_IPV4
=
$(
ifconfig
$INTERFACE_CORE
|
grep
"inet "
|
awk
'{print $2}'
)
ACC
ESS_IPV4
=
$(
ifconfig
$INTERFACE_ACCESS
|
grep
"inet "
|
awk
'{print $2}'
)
C
ORE
_IPV4
=
$(
ifconfig
$INTERFACE_CP
|
grep
"inet "
|
awk
'{print $2}'
)
EGRESS
_IPV4
=
$(
ifconfig
$INTERFACE_CORE
|
grep
"inet "
|
awk
'{print $2}'
)
INGR
ESS_IPV4
=
$(
ifconfig
$INTERFACE_ACCESS
|
grep
"inet "
|
awk
'{print $2}'
)
C
P
_IPV4
=
$(
ifconfig
$INTERFACE_CP
|
grep
"inet "
|
awk
'{print $2}'
)
N3_IPV4_ADDRESS_LOCAL
=
${
N3_IPV4_ADDRESS
_LOCAL
:-
$(
ifconfig
$INTERFACE_ACCESS
|
grep
"inet "
|
awk
'{print $2}'
|
cut
-d
"."
-f1-3
)
".202"
}
INGRESS_INT_ADDR_LOCAL
=
${
INGRESS_INT_ADDR
_LOCAL
:-
$(
ifconfig
$INTERFACE_ACCESS
|
grep
"inet "
|
awk
'{print $2}'
|
cut
-d
"."
-f1-3
)
".202"
}
N4_IPV4_ADDRESS_LOCAL
=
${
N4_IPV4_ADDRESS_LOCAL
:-
$(
ifconfig
$INTERFACE_CP
|
grep
"inet "
|
awk
'{print $2}'
|
cut
-d
"."
-f1-3
)
".202"
}
N6_IPV4_ADDRESS_LOCAL
=
${
N6_IPV4_ADDRESS
_LOCAL
:-
$(
ifconfig
$INTERFACE_CORE
|
grep
"inet "
|
awk
'{print $2}'
|
cut
-d
"."
-f1-3
)
".202"
}
EGRESS_INT_ADDR_LOCAL
=
${
EGRESS_INT_ADDR
_LOCAL
:-
$(
ifconfig
$INTERFACE_CORE
|
grep
"inet "
|
awk
'{print $2}'
|
cut
-d
"."
-f1-3
)
".202"
}
N3_IPV4_ADDRESS_REMOTE
=
${
N3_IPV4_ADDRESS
_REMOTE
:-
$(
ifconfig
$INTERFACE_ACCESS
|
grep
"inet "
|
awk
'{print $2}'
|
cut
-d
"."
-f1-3
)
".1"
}
INGRESS_INT_ADDR_REMOTE
=
${
INGRESS_INT_ADDR
_REMOTE
:-
$(
ifconfig
$INTERFACE_ACCESS
|
grep
"inet "
|
awk
'{print $2}'
|
cut
-d
"."
-f1-3
)
".1"
}
N4_IPV4_ADDRESS_REMOTE
=
${
N4_IPV4_ADDRESS_REMOTE
:-
$(
ifconfig
$INTERFACE_CP
|
grep
"inet "
|
awk
'{print $2}'
|
cut
-d
"."
-f1-3
)
".1"
}
N6_IPV4_ADDRESS_REMOTE
=
${
N6_IPV4_ADDRESS
_REMOTE
:-
$(
ifconfig
$INTERFACE_CORE
|
grep
"inet "
|
awk
'{print $2}'
|
cut
-d
"."
-f1-3
)
".1"
}
EGRESS_INT_ADDR_REMOTE
=
${
EGRESS_INT_ADDR
_REMOTE
:-
$(
ifconfig
$INTERFACE_CORE
|
grep
"inet "
|
awk
'{print $2}'
|
cut
-d
"."
-f1-3
)
".1"
}
###############################
# UPF Config
###############################
array
=(
${
CONFIG_DIR
}
/
*
.conf
${
CONFIG_DIR
}
/
*
.json
${
BIN_DIR
}
/nrf_client.sh
)
for
c
in
"
${
array
[@]
}
"
;
do
# grep variable names (format: ${VAR}) from template to be rendered
# grep variable names (format: ${VAR}) from tem
for
plate to be rendered
VARS
=
$(
grep
-oP
'@[a-zA-Z0-9_]+@'
${
c
}
|
sort
|
uniq
| xargs
)
# create sed expressions for substituting each occurrence of ${VAR}
# with the value of the environment variable "VAR"
...
...
@@ -89,18 +105,18 @@ done
#
ip
link set
$INTERFACE_ACCESS
down
ip
link set
$INTERFACE_ACCESS
name
n3
ip
link set
n3
up
ip
link set
$INTERFACE_ACCESS
name
$INGRESS_INTERFACE
ip
link set
$INGRESS_INTERFACE
up
ip
link set
$INTERFACE_CP
down
ip
link set
$INTERFACE_CP
name n4
ip
link set
n4 up
ip
link set
$INTERFACE_CORE
down
ip
link set
$INTERFACE_CORE
name
n6
ip
link set
n6
up
ip
link set
$INTERFACE_CORE
name
$EGRESS_INTERFACE
ip
link set
$EGRESS_INTERFACE
up
ip route add
$NETWORK_UE_IP
via
$
SGI_IPV4
dev n6
ip route add
$NETWORK_UE_IP
via
$
EGRESS_IPV4
dev
$EGRESS_INTERFACE
echo
"Done setting the configuration"
...
...
scripts/upf_conf/init.conf
100755 → 100644
View file @
de7932b1
ip
table
add
1
ip
table
add
2
create
host
-
interface
name
n6
set
interface
mtu
1500
host
-
n6
set
interface
ip
table
host
-
n6
1
set
interface
ip
address
host
-
n6
@
N6_IPV4_ADDRESS
_LOCAL
@/
24
set
interface
state
host
-
n6
up
create
host
-
interface
name
@
EGRESS_INTERFACE
@
set
interface
mtu
1500
host
-
@
EGRESS_INTERFACE
@
set
interface
ip
table
host
-
@
EGRESS_INTERFACE
@
1
set
interface
ip
address
host
-
@
EGRESS_INTERFACE
@ @
EGRESS_INT_ADDR
_LOCAL
@/
24
set
interface
state
host
-
@
EGRESS_INTERFACE
@
up
create
host
-
interface
name
n4
set
interface
mtu
1500
host
-
n4
...
...
@@ -13,22 +13,23 @@ set interface ip table host-n4 0
set
interface
ip
address
host
-
n4
@
N4_IPV4_ADDRESS_LOCAL
@/
24
set
interface
state
host
-
n4
up
create
host
-
interface
name
n3
set
interface
mtu
1500
host
-
n3
set
interface
ip
table
host
-
n3
2
set
interface
ip
address
host
-
n3
@
N3_IPV4_ADDRESS
_LOCAL
@/
24
set
interface
state
host
-
n3
up
create
host
-
interface
name
@
INGRESS_INTERFACE
@
set
interface
mtu
1500
host
-
@
INGRESS_INTERFACE
@
set
interface
ip
table
host
-
@
INGRESS_INTERFACE
@
2
set
interface
ip
address
host
-
@
INGRESS_INTERFACE
@ @
INGRESS_INT_ADDR
_LOCAL
@/
24
set
interface
state
host
-
@
INGRESS_INTERFACE
@
up
ip
route
add
0
.
0
.
0
.
0
/
0
table
2
via
@
N3_IPV4_ADDRESS_REMOTE
@
host
-
n3
ip
route
add
0
.
0
.
0
.
0
/
0
table
2
via
@
INGRESS_INT_ADDR_REMOTE
@
host
-@
INGRESS_INTERFACE
@
ip
route
add
0
.
0
.
0
.
0
/
0
table
0
via
@
N4_IPV4_ADDRESS_REMOTE
@
host
-
n4
ip
route
add
0
.
0
.
0
.
0
/
0
table
1
via
@
N6_IPV4_ADDRESS_REMOTE
@
host
-
n6
ip
route
add
0
.
0
.
0
.
0
/
0
table
1
via
@
EGRESS_INT_ADDR_REMOTE
@
host
-@
EGRESS_INTERFACE
@
upf
pfcp
endpoint
ip
@
N4_IPV4_ADDRESS_LOCAL
@
vrf
0
upf
node
-
id
fqdn
gw
@
GW_ID
@.
vppupf
.
node
.
5
gcn
.
mnc
@
MNC03
@.
mcc
@
MCC
@.@
REALM
@
upf
nwi
name
@
NWI_
N3
@
vrf
2
upf
nwi
name
@
NWI_
N6
@
vrf
1
upf
nwi
name
@
NWI_
INGRESS
@
vrf
2
upf
nwi
name
@
NWI_
ENGRESS
@
vrf
1
upf
specification
release
16
upf
gtpu
endpoint
ip
@
N3_IPV4_ADDRESS_LOCAL
@
nwi
@
NWI_N3
@
teid
0
x000004d2
/
2
upf
gtpu
endpoint
ip
@
INGRESS_INT_ADDR_LOCAL
@
nwi
@
NWI_INGRESS
@
teid
0
x000004d2
/
2
scripts/upf_conf/upf_profile.json
View file @
de7932b1
...
...
@@ -25,16 +25,17 @@
}
}],
"interfaceUpfInfoList"
:
[{
"endpointFqdn"
:
"@NWI_
N3
@"
,
"interfaceType"
:
"
N3
"
,
"ipv4EndpointAddresses"
:
[
"@
ACC
ESS_IPV4@"
],
"networkInstance"
:
"@NWI_
N3
@"
"endpointFqdn"
:
"@NWI_
INGRESS
@"
,
"interfaceType"
:
"
@INGRESS_INT@
"
,
"ipv4EndpointAddresses"
:
[
"@
INGR
ESS_IPV4@"
],
"networkInstance"
:
"@NWI_
INGRESS
@"
},
{
"endpointFqdn"
:
"@NWI_
N6
@"
,
"interfaceType"
:
"
N6
"
,
"ipv4EndpointAddresses"
:
[
"@
SGI
_IPV4@"
],
"networkInstance"
:
"@NWI_
N6
@"
"endpointFqdn"
:
"@NWI_
ENGRESS
@"
,
"interfaceType"
:
"
@EGRESS_INT@
"
,
"ipv4EndpointAddresses"
:
[
"@
EGRESS
_IPV4@"
],
"networkInstance"
:
"@NWI_
ENGRESS
@"
}]
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment