summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/dns-forwarding/vyatta-dns-forwarding.pl18
-rw-r--r--templates/system/ip/disable-forwarding/node.def3
-rw-r--r--templates/system/ip/node.def1
-rw-r--r--templates/system/ipv6/disable-forwarding/node.def3
-rw-r--r--templates/system/ipv6/node.def1
5 files changed, 17 insertions, 9 deletions
diff --git a/scripts/dns-forwarding/vyatta-dns-forwarding.pl b/scripts/dns-forwarding/vyatta-dns-forwarding.pl
index 6cdcfaa0..d0d7e36c 100644
--- a/scripts/dns-forwarding/vyatta-dns-forwarding.pl
+++ b/scripts/dns-forwarding/vyatta-dns-forwarding.pl
@@ -57,7 +57,7 @@ sub dnsforwarding_get_constants {
sub dnsforwarding_get_values {
- my $dhclient_script = shift;
+ my $outside_cli = shift;
my $output = '';
my $config = new VyattaConfig;
@@ -66,7 +66,7 @@ sub dnsforwarding_get_values {
$config->setLevel("service dns forwarding");
- if ($dhclient_script == 1){
+ if ($outside_cli == 1){
$config->{_active_dir_base} = "/opt/vyatta/config/active/";
@listen_interfaces = $config->returnOrigValues("listen-on");
$cache_size = $config->returnOrigValue("cache-size");
@@ -104,7 +104,7 @@ sub dnsforwarding_get_values {
my $sys_config = new VyattaConfig;
$sys_config->setLevel("system");
my @system_nameservers;
- if ($dhclient_script == 1){
+ if ($outside_cli == 1){
$sys_config->{_active_dir_base} = "/opt/vyatta/config/active/";
@system_nameservers = $sys_config->returnOrigValues("name-server");
} else {
@@ -255,12 +255,12 @@ sub check_dhcp_interface {
# main
#
-my ($update_dnsforwarding, $stop_dnsforwarding, $system_nameserver, $dhcp_interface, $dhclient_script);
+my ($update_dnsforwarding, $stop_dnsforwarding, $system_nameserver, $dhcp_interface, $outside_cli);
GetOptions("update-dnsforwarding!" => \$update_dnsforwarding,
"stop-dnsforwarding!" => \$stop_dnsforwarding,
"system-nameserver!" => \$system_nameserver,
- "dhclient-script!" => \$dhclient_script,
+ "outside-cli!" => \$outside_cli,
"dhcp-interface=s" => \$dhcp_interface);
if (defined $system_nameserver) {
@@ -293,12 +293,12 @@ if (defined $update_dnsforwarding) {
}
}
- my $called_from_dhclient_script = 0;
- if (defined $dhclient_script){
- $called_from_dhclient_script = 1;
+ my $called_from_outside_cli = 0;
+ if (defined $outside_cli){
+ $called_from_outside_cli = 1;
}
$config = dnsforwarding_get_constants();
- $config .= dnsforwarding_get_values($called_from_dhclient_script);
+ $config .= dnsforwarding_get_values($called_from_outside_cli);
dnsforwarding_write_file($config);
dnsforwarding_restart();
}
diff --git a/templates/system/ip/disable-forwarding/node.def b/templates/system/ip/disable-forwarding/node.def
new file mode 100644
index 00000000..3bac48b3
--- /dev/null
+++ b/templates/system/ip/disable-forwarding/node.def
@@ -0,0 +1,3 @@
+help: Disable IPv4 forwarding
+create: sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/all/forwarding"
+delete: sudo sh -c "echo 1 > /proc/sys/net/ipv4/conf/all/forwarding"
diff --git a/templates/system/ip/node.def b/templates/system/ip/node.def
new file mode 100644
index 00000000..c354d882
--- /dev/null
+++ b/templates/system/ip/node.def
@@ -0,0 +1 @@
+help: Set IPv4 settings
diff --git a/templates/system/ipv6/disable-forwarding/node.def b/templates/system/ipv6/disable-forwarding/node.def
new file mode 100644
index 00000000..5a7576c3
--- /dev/null
+++ b/templates/system/ipv6/disable-forwarding/node.def
@@ -0,0 +1,3 @@
+help: Disable IPv6 forwarding
+create: sudo sh -c "echo 0 > /proc/sys/net/ipv6/conf/all/forwarding"
+delete: sudo sh -c "echo 1 > /proc/sys/net/ipv6/conf/all/forwarding"
diff --git a/templates/system/ipv6/node.def b/templates/system/ipv6/node.def
new file mode 100644
index 00000000..7a7c2715
--- /dev/null
+++ b/templates/system/ipv6/node.def
@@ -0,0 +1 @@
+help: Set IPv6 settings