Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
oai-cn5g-fed
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
oai
cn5g
oai-cn5g-fed
Commits
1dd2fad5
Commit
1dd2fad5
authored
1 year ago
by
Raphael Defosseux
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'origin/develop-new-upf' into doc-update-new-upf
parents
2b70cfe1
5a87092a
No related branches found
No related tags found
1 merge request
!139
chore(ci): merging UPF-based tutorials and documentations to develop
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ci-scripts/trfgen_entrypoint.sh
+68
-8
68 additions, 8 deletions
ci-scripts/trfgen_entrypoint.sh
docker-compose/docker-compose-basic-nrf-ebpf.yaml
+3
-0
3 additions, 0 deletions
docker-compose/docker-compose-basic-nrf-ebpf.yaml
with
71 additions
and
8 deletions
ci-scripts/trfgen_entrypoint.sh
+
68
−
8
View file @
1dd2fad5
...
...
@@ -4,16 +4,76 @@ EBPF_GW_SETUP=${EBPF_GW_SETUP:-no}
EBPF_GW_MTU
=
${
EBPF_GW_MTU
:-
1460
}
if
[[
${
EBPF_GW_SETUP
}
==
"yes"
]]
;
then
echo
-e
"Trying to disable TCP checksum and to setup MTU on N6 interface"
N6_IF_NAME
=(
`
ifconfig |
grep
-B1
"inet
$EBPF_GW_N6_IP_ADDR
"
|
awk
'$1!="inet" && $1!="--" {print $1}'
|
sed
-e
"s@:@@"
`
)
echo
-e
"N6 interface is
$N6_IF_NAME
"
ethtool
-K
$N6_IF_NAME
tx off
ifconfig
$N6_IF_NAME
mtu
$EBPF_GW_MTU
ifconfig
$N6_IF_NAME
echo
-e
"Adding UE IP routing to the N6 interface of UPF"
ip route add
$UE_IP_ADDRESS_POOL
via
$N6_UPF_IP_ADDR
dev
$N6_IF_NAME
ip route
N3_IF_NAME
=(
`
ifconfig |
grep
-B1
"inet
$GW_N3_IP_ADDR
"
|
awk
'$1!="inet" && $1!="--" {print $1}'
|
sed
-e
"s@:@@"
`
)
SGI_IF_NAME
=(
`
ifconfig |
grep
-B1
"inet
$GW_SGI_IP_ADDR
"
|
awk
'$1!="inet" && $1!="--" {print $1}'
|
sed
-e
"s@:@@"
`
)
DEFAULT_ROUTE
=(
`
ip route show default
`
)
if
[[
-n
"
$N6_IF_NAME
"
]]
;
then
echo
echo
-e
"1. Disable TCP Checksum on N6 interface (
$N6_IF_NAME
):"
ethtool
-K
$N6_IF_NAME
tx off
echo
echo
-e
"2. Setup MTU (
$EBPF_GW_MTU
) on N6 interface (
$N6_IF_NAME
):"
ifconfig
$N6_IF_NAME
mtu
$EBPF_GW_MTU
ifconfig
$N6_IF_NAME
echo
echo
-e
"3. Add a route to UE subnet (
$UE_IP_ADDRESS_POOL
) via UPF N6 interface (
$N6_UPF_IP_ADDR
):"
ip route add
$UE_IP_ADDRESS_POOL
via
$N6_UPF_IP_ADDR
dev
$N6_IF_NAME
else
echo
echo
-e
"N6 interface does not exist;
\n
The UPF will not be able to reach the
\n
Gateway neither the Internet"
echo
fi
if
[[
-n
"
$N3_IF_NAME
"
]]
;
then
echo
echo
-e
"4. Disable the useless N3 interface (
$N3_IF_NAME
):"
ifconfig
$N3_IF_NAME
down
fi
if
[[
-n
"
$SGI_IF_NAME
"
]]
;
then
echo
echo
-e
"5. Update the default route:"
if
[[
-n
"
$DEFAULT_ROUTE
"
]]
;
then
echo
"Delete the default route:
$DEFAULT_ROUTE
"
ip route del default
fi
echo
-e
"Sgi interface is
$SGI_IF_NAME
"
ip route add default via
$SGI_DEMO_OAI_ADDR
ip route
else
echo
-e
"Sgi interface does not exist;
\n
The UPF will not be able to reach the Internet"
fi
echo
echo
"6. Add SNAT rule to allow UE traffic to reach the internet:"
iptables
-t
nat
-A
POSTROUTING
-o
$SGI_IF_NAME
-s
$UE_IP_ADDRESS_POOL
-j
SNAT
--to-source
$GW_SGI_IP_ADDR
fi
echo
"Done setting the configuration"
echo
echo
-e
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo
"Gateway Has the following configuration :"
echo
echo
" +---------------+ "
echo
" | | "
echo
" (UPF)----------| OAI-EXT-GW |----------- (Internet)"
echo
" N6 | | Sgi "
echo
" +---------------+ "
echo
echo
" GW N6 Interface ----------------: (Ifname, IPv4, MTU) = (
${
N6_IF_NAME
}
,
$(
ip addr show
"
${
N6_IF_NAME
}
"
|
grep
-oE
'inet ([0-9]+\.){3}[0-9]+'
|
awk
'{print $2}'
)
,
$(
ip
link
show
"
$N6_IF_NAME
"
|
awk
'/mtu/ {print $5}'
)
)"
echo
" GW Sgi Interface ---------------: (Ifname, IPv4, MTU) = (
${
SGI_IF_NAME
}
,
$(
ip addr show
"
${
SGI_IF_NAME
}
"
|
grep
-oE
'inet ([0-9]+\.){3}[0-9]+'
|
awk
'{print $2}'
)
,
$(
ip
link
show
"
$SGI_IF_NAME
"
|
awk
'/mtu/ {print $5}'
)
)"
echo
" GW Default Route ---------------:
$(
ip route show default
)
"
echo
" Route to UE --------------------:
$(
ip route show |
grep
-E
"
${
UE_IP_ADDRESS_POOL
}
.*via
${
N6_UPF_IP_ADDR
}
.*dev
${
N6_IF_NAME
}
"
)
"
echo
" Iptables Postrouting -----------:
$(
iptables
-t
nat
-L
|
grep
-E
"SNAT.*
${
UE_IP_ADDRESS_POOL
}
.*to:
${
GW_SGI_IP_ADDR
}
"
)
"
echo
echo
-e
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo
exec
"
$@
"
This diff is collapsed.
Click to expand it.
docker-compose/docker-compose-basic-nrf-ebpf.yaml
+
3
−
0
View file @
1dd2fad5
...
...
@@ -148,8 +148,11 @@ services:
environment
:
-
EBPF_GW_SETUP=yes
-
EBPF_GW_N6_IP_ADDR=192.168.72.135
-
GW_SGI_IP_ADDR=192.168.70.135
-
GW_N3_IP_ADDR=192.168.71.135
-
UE_IP_ADDRESS_POOL=12.1.1.0/24
-
N6_UPF_IP_ADDR=192.168.72.129
-
SGI_DEMO_OAI_ADDR=192.168.70.129
healthcheck
:
test
:
/bin/bash -c "ip r | grep 12.1.1"
interval
:
10s
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment