Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
d2f61e75
Commit
d2f61e75
authored
May 11, 2017
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rc: ask for tracking, too
parent
04fb94b4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
9 deletions
+31
-9
rc.initial.setlanip
src/etc/rc.initial.setlanip
+31
-9
No files found.
src/etc/rc.initial.setlanip
View file @
d2f61e75
...
...
@@ -98,6 +98,7 @@ function prompt_for_enable_dhcp_server($version = 4)
$label_DHCP
=
(
$version
===
6
)
?
'DHCP6'
:
'DHCP'
;
$upperifname
=
strtoupper
(
$interface
);
return
console_prompt_for_yn
(
sprintf
(
'Do you want to enable the %s server on %s?'
,
$label_DHCP
,
$upperifname
),
'y'
);
}
...
...
@@ -243,9 +244,9 @@ function console_configure_ip_address($version)
{
global
$config
,
$interface
,
$restart_dhcpd
,
$ifaceassigned
,
$fp
;
$label_IPvX
=
(
$version
===
6
)
?
"IPv6"
:
"IPv4"
;
$label_IPvX
=
(
$version
===
6
)
?
'IPv6'
:
'IPv4'
;
$maxbits
=
(
$version
===
6
)
?
127
:
31
;
$label_DHCP
=
(
$version
===
6
)
?
"DHCP6"
:
"DHCP"
;
$label_DHCP
=
(
$version
===
6
)
?
'DHCP6'
:
'DHCP'
;
$upperifname
=
strtoupper
(
$interface
);
...
...
@@ -259,6 +260,14 @@ function console_configure_ip_address($version)
$isintdhcp
=
true
;
$restart_dhcpd
=
true
;
echo
"
\n
"
;
}
elseif
(
$interface
!=
'wan'
&&
$version
===
6
&&
!
empty
(
$config
[
'interfaces'
][
'wan'
][
'ipaddrv6'
])
&&
$config
[
'interfaces'
][
'wan'
][
'ipaddrv6'
]
==
'dhcp6'
)
{
if
(
console_prompt_for_yn
(
sprintf
(
'Configure %s address %s interface via WAN tracking?'
),
'y'
))
{
$intip
=
'track6'
;
$intbits
=
'64'
;
$isintdhcp
=
true
;
$restart_dhcpd
=
true
;
}
}
if
(
!
$isintdhcp
)
{
...
...
@@ -358,6 +367,7 @@ list($intip6, $intbits6, $gwname6) = console_configure_ip_address(6);
if
(
!
empty
(
$ifaceassigned
))
{
$config
[
'interfaces'
][
$interface
][
'if'
]
=
$ifaceassigned
;
}
$config
[
'interfaces'
][
$interface
][
'ipaddr'
]
=
$intip
;
$config
[
'interfaces'
][
$interface
][
'subnet'
]
=
$intbits
;
$config
[
'interfaces'
][
$interface
][
'gateway'
]
=
$gwname
;
...
...
@@ -366,6 +376,18 @@ $config['interfaces'][$interface]['subnetv6'] = $intbits6;
$config
[
'interfaces'
][
$interface
][
'gatewayv6'
]
=
$gwname6
;
$config
[
'interfaces'
][
$interface
][
'enable'
]
=
true
;
if
(
$intip6
==
'track6'
)
{
$config
[
'interfaces'
][
$interface
][
'track6-interface'
]
=
'wan'
;
$config
[
'interfaces'
][
$interface
][
'track6-prefix-id'
]
=
'0'
;
}
else
{
if
(
isset
(
$config
[
'interfaces'
][
$interface
][
'track6-interface'
]))
{
unset
(
$config
[
'interfaces'
][
$interface
][
'track6-interface'
]);
}
if
(
isset
(
$config
[
'interfaces'
][
$interface
][
'track6-prefix-id'
]))
{
unset
(
$config
[
'interfaces'
][
$interface
][
'track6-prefix-id'
]);
}
}
function
console_configure_dhcpd
(
$version
=
4
)
{
global
$config
,
$restart_dhcpd
,
$fp
,
$interface
,
$intip
,
$intbits
,
$intip6
,
$intbits6
;
...
...
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