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
756cfc9b
Commit
756cfc9b
authored
May 24, 2021
by
吴洲洋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add nat
parent
7dca8db7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
src/vppe/src/vlib/unix/main.c
src/vppe/src/vlib/unix/main.c
+8
-3
No files found.
src/vppe/src/vlib/unix/main.c
View file @
756cfc9b
...
...
@@ -379,8 +379,10 @@ startup_config_process (vlib_main_t * vm,
{
//add it to inif config in 20210311
{
#define BUF_LEN 1024
#define IF_UP_IPADDR "set interface state %s up\nset interface ip address %s %s/%d\n\n"
#define BUF_LEN 1024
#define IF_UP_IPADDR "set interface state %s up\nset interface ip address %s %s/%d\n\n"
#define SET_INTER_NAT44 "set interface nat44 in %s out %s output-feature\n\n"
#define SET_NAT44_ADDRESS "nat44 add address %s\n\n"
u8
*
buf
=
NULL
;
char
cmd
[
BUF_LEN
]
=
{
0
};
...
...
@@ -389,12 +391,15 @@ startup_config_process (vlib_main_t * vm,
strcat
(
if_cmd
,
IF_UP_IPADDR
);
strcat
(
if_cmd
,
IF_UP_IPADDR
);
strcat
(
if_cmd
,
"ip route add 0.0.0.0/0 via %s %s
\n\n
"
);
strcat
(
if_cmd
,
SET_INTER_NAT44
);
strcat
(
if_cmd
,
SET_NAT44_ADDRESS
);
snprintf
(
cmd
,
BUF_LEN
,
if_cmd
,
if_info
->
if_n3
.
name
,
if_info
->
if_n3
.
name
,
if_info
->
if_n3
.
ipaddr
,
if_info
->
if_n3
.
netmask
,
if_info
->
if_n6
.
name
,
if_info
->
if_n6
.
name
,
if_info
->
if_n6
.
ipaddr
,
if_info
->
if_n6
.
netmask
,
if_info
->
if_n6
.
name
,
if_info
->
if_n6
.
gateway
);
if_info
->
if_n6
.
name
,
if_info
->
if_n6
.
gateway
,
if_info
->
if_n3
.
name
,
if_info
->
if_n6
.
name
,
if_info
->
if_n6
.
ipaddr
);
vec_resize
(
buf
,
strlen
(
cmd
));
strncpy
((
char
*
)
buf
,
cmd
,
strlen
(
cmd
));
...
...
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