Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

close 53 #46

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions systemvm/debian/opt/cloud/bin/cs/CsAddress.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import time
import CsHelper
from CsDatabag import CsDataBag
from CsApp import CsApache, CsDnsmasq, CsPasswdSvc
from CsApp import CsApache, CsPasswdSvc
from CsRoute import CsRoute
from CsRule import CsRule

Expand Down Expand Up @@ -566,10 +566,6 @@ def post_config_change(self, method):
logging.error(
"Not able to setup source-nat for a regular router yet")

if self.config.has_dns() or self.config.is_dhcp():
dns = CsDnsmasq(self)
dns.add_firewall_rules()

if self.config.has_metadata():
app = CsApache(self)
app.setup()
Expand Down
21 changes: 0 additions & 21 deletions systemvm/debian/opt/cloud/bin/cs/CsApp.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,24 +81,3 @@ def stop(self):
def restart(self):
CsHelper.service("cloud-password-server@%s" % self.ip, "restart")


class CsDnsmasq(CsApp):
""" Set up dnsmasq """

def add_firewall_rules(self):
""" Add the necessary firewall rules
"""
self.fw.append(["", "front",
"-A INPUT -i %s -p udp -m udp --dport 67 -j ACCEPT" % self.dev
])

if self.config.has_dns():
self.fw.append([
"", "front",
"-A INPUT -i %s -d %s/32 -p udp -m udp --dport 53 -j ACCEPT" % (self.dev, self.ip)
])

self.fw.append([
"", "front",
"-A INPUT -i %s -d %s/32 -p tcp -m tcp --dport 53 -j ACCEPT" % (self.dev, self.ip)
])