Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
61b7b8b0
authored
Dec 10, 2013
by
Bach Dániel
Committed by
Guba Sándor
Dec 10, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall: add Vlan.network_type
parent
d5fe25eb
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
0 deletions
+11
-0
circle/firewall/migrations/0040_auto__add_field_vlan_network_type.py
+0
-0
circle/firewall/models.py
+5
-0
circle/vm/models/network.py
+6
-0
No files found.
circle/firewall/migrations/0040_auto__add_field_vlan_network_type.py
0 → 100644
View file @
61b7b8b0
This diff is collapsed.
Click to expand it.
circle/firewall/models.py
View file @
61b7b8b0
...
@@ -170,6 +170,8 @@ class Vlan(models.Model):
...
@@ -170,6 +170,8 @@ class Vlan(models.Model):
range. The gateway also has an IP address in each range.
range. The gateway also has an IP address in each range.
"""
"""
CHOICES_NETWORK_TYPE
=
((
'public'
,
_
(
'public'
)),
(
'dmz'
,
_
(
'dmz'
)),
(
'portforward'
,
_
(
'portforward'
)))
vid
=
models
.
IntegerField
(
unique
=
True
,
vid
=
models
.
IntegerField
(
unique
=
True
,
verbose_name
=
_
(
'VID'
),
verbose_name
=
_
(
'VID'
),
help_text
=
_
(
'The vlan ID of the subnet.'
),
help_text
=
_
(
'The vlan ID of the subnet.'
),
...
@@ -215,6 +217,9 @@ class Vlan(models.Model):
...
@@ -215,6 +217,9 @@ class Vlan(models.Model):
'translated, i.e. their source '
'translated, i.e. their source '
'address is rewritten to the value '
'address is rewritten to the value '
'of NAT IP address.'
))
'of NAT IP address.'
))
network_type
=
models
.
CharField
(
choices
=
CHOICES_NETWORK_TYPE
,
verbose_name
=
_
(
'network type'
),
max_length
=
20
)
description
=
models
.
TextField
(
blank
=
True
,
verbose_name
=
_
(
'description'
),
description
=
models
.
TextField
(
blank
=
True
,
verbose_name
=
_
(
'description'
),
help_text
=
_
(
help_text
=
_
(
'Description of the goals and elements '
'Description of the goals and elements '
...
...
circle/vm/models/network.py
View file @
61b7b8b0
...
@@ -110,6 +110,12 @@ class Interface(Model):
...
@@ -110,6 +110,12 @@ class Interface(Model):
host
.
ipv4
=
addresses
[
'ipv4'
]
host
.
ipv4
=
addresses
[
'ipv4'
]
host
.
ipv6
=
addresses
[
'ipv6'
]
host
.
ipv6
=
addresses
[
'ipv6'
]
host
.
owner
=
owner
host
.
owner
=
owner
if
vlan
.
network_type
==
'public'
:
host
.
shared_ip
=
False
host
.
pub_ipv4
=
None
elif
vlan
.
network_type
==
'portforward'
:
host
.
shared_ip
=
True
host
.
pub_ipv4
=
vlan
.
snat_ip
host
.
full_clean
()
host
.
full_clean
()
host
.
save
()
host
.
save
()
else
:
else
:
...
...
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