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
d0a95924
Commit
d0a95924
authored
Jun 07, 2021
by
吴洲洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update upf configure content
parent
756cfc9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
51 deletions
+7
-51
etc/upf.yaml
etc/upf.yaml
+5
-10
scripts/run_upf.sh
scripts/run_upf.sh
+2
-41
No files found.
etc/upf.yaml
View file @
d0a95924
vpp
:
system
:
gtpu_entry_ip
:
192.168.
10.40
gtpu_export_ip
:
192.168.
50.10
gtpu_entry_ip
:
192.168.
2.182
gtpu_export_ip
:
192.168.
2.22
ip_link
:
ueip
:
192.169.0.0
ueIPPrefix
:
24
snatInter
:
ens32
snatIP
:
192.168.2.78
vppHost
:
ens35
vppHostIP
:
192.168.50.11
vppHostIP
:
192.168.2.1
gtpu_entry
:
ens33
gtpu_export
:
ens34
cpu
:
3f
n4
:
smf
:
192.168.2.3
9
upf
:
192.168.2.
78
smf
:
192.168.2.3
5
upf
:
192.168.2.
21
logSize
:
100
scripts/run_upf.sh
View file @
d0a95924
...
...
@@ -42,16 +42,7 @@ function init_configure(){
cp
-r
$configure
/template /opt/5gc
$base
/plugin/configure
-i
$yaml
-o
/opt/5gc
cp
$base
/plugin/yq
$current
# arp
UEIP
=
$(
$current
/yq r
$yaml
vpp.ip_link.ueip
)
PREFIX
=
$(
$current
/yq r
$yaml
vpp.ip_link.ueIPPrefix
)
INTER
=
$(
$current
/yq r
$yaml
vpp.ip_link.vppHost
)
VPPEXPORT
=
$(
$current
/yq r
$yaml
vpp.system.gtpu_export_ip
)
MAC
=
$(
ifconfig
$INTER
|grep ether|awk
'{print $2}'
)
# nat
UE_IP
=
$(
$current
/yq r
$yaml
vpp.ip_link.ueip
)
UE_IP_PREFIX
=
$(
$current
/yq r
$yaml
vpp.ip_link.ueIPPrefix
)
SNAT_INTER
=
$(
$current
/yq r
$yaml
vpp.ip_link.snatInter
)
SNAT_IP
=
$(
$current
/yq r
$yaml
vpp.ip_link.snatIP
)
VPPHOST
=
$(
$current
/yq r
$yaml
vpp.ip_link.vppHost
)
DPDK_EXPORT
=
$(
$current
/yq r
$yaml
vpp.ip_link.gtpu_export
)
...
...
@@ -65,7 +56,6 @@ function start_vpp() {
cmd
=
"
$VPPCMD
"
install_dpdk_kmod
run_nat
$base
/plugin/interreput
-i
$CPUNUMBER
echo
Y |
sudo tee
/sys/module/vfio/parameters/enable_unsafe_noiommu_mode
$cmd
>
/dev/null 2>&1 &
...
...
@@ -88,6 +78,7 @@ function start_n4() {
else
echo
"n4
$pid2
startup success"
fi
exit
0
}
function
start_arp
()
{
...
...
@@ -128,6 +119,7 @@ function close_n4() {
echo
"kill n4
$pid
"
kill
-9
${
pid
}
fi
exit
0
}
function
close_arp
()
{
...
...
@@ -160,34 +152,6 @@ function exec_result()
}
function
run_nat
(){
echo
"
$UE_IP
"
echo
"
$UE_IP_PREFIX
"
echo
"
$SNAT_INTER
"
echo
"
$SNAT_IP
"
echo
"
$VPPHOST
"
echo
"
$DPDK_EXPORT
"
echo
"
$DPDK_ENTRY
"
sudo
ifconfig
$DPDK_EXPORT
down
sudo
ifconfig
$DPDK_ENTRY
down
sudo
ethtool
-K
"
$SNAT_INTER
"
gro off
;
sudo
ethtool
-K
"
$SNAT_INTER
"
tso off
;
sudo
ethtool
-K
"
$SNAT_INTER
"
sg off
;
#del
sudo
iptables
-t
nat
-D
POSTROUTING
-s
"
$UE_IP
/
$UE_IP_PREFIX
"
-j
SNAT
--to-source
"
$SNAT_IP
"
iptables
-t
mangle
-D
POSTROUTING
-p
tcp
--tcp-flags
SYN,RST SYN
-o
"
$SNAT_INTER
"
-j
TCPMSS
--set-mss
1300
#add
sudo
iptables
-t
nat
-A
POSTROUTING
-s
"
$UE_IP
/
$UE_IP_PREFIX
"
-j
SNAT
--to-source
"
$SNAT_IP
"
iptables
-t
mangle
-A
POSTROUTING
-p
tcp
--tcp-flags
SYN,RST SYN
-o
"
$SNAT_INTER
"
-j
TCPMSS
--set-mss
1300
#system
echo
"1"
>
/proc/sys/net/ipv4/ip_forward
}
function
help
()
{
echo
" "
...
...
@@ -233,14 +197,11 @@ function main() {
init_configure
$2
start_vpp
start_n4
start_arp
shift
;;
--close
)
close_vpp
close_n4
close_arp
# unbind
shift
;;
esac
...
...
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