From b1d8d8320bc4550849ad6b3da5733b8d35ce6f6e Mon Sep 17 00:00:00 2001 From: Alex Harpin Date: Sat, 24 Jan 2015 14:02:32 +0000 Subject: vyatta-cfg-system: remove default speed value for console access Remove the default value for the console speed node as this is already set by the system. Update the help text to display the defaults for both serial and Xen consoles. --- templates/system/console/device/node.tag/speed/node.def | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/system/console/device/node.tag/speed/node.def b/templates/system/console/device/node.tag/speed/node.def index 8453f67d..e7515dca 100644 --- a/templates/system/console/device/node.tag/speed/node.def +++ b/templates/system/console/device/node.tag/speed/node.def @@ -1,6 +1,5 @@ type: u32 help: Console baud rate -default: 9600 allowed: echo 1200 2400 4800 9600 19200 38400 57600 115200 syntax:expression: $VAR(@) in 1200, 2400, 4800, 9600, 19200, 38400, \ 57600, 115200 ; "unknown baud rate" @@ -8,9 +7,9 @@ syntax:expression: $VAR(@) in 1200, 2400, 4800, 9600, 19200, 38400, \ val_help: 1200; 1200 bps val_help: 2400; 2400 bps val_help: 4800; 4800 bps -val_help: 9600; 9600 bps (default) +val_help: 9600; 9600 bps (default for serial console) val_help: 19200; 19,200 bps -val_help: 38400; 38,400 bps +val_help: 38400; 38,400 bps (default for Xen console) val_help: 57600; 57,600 bps val_help: 115200; 115,200 bps -- cgit v1.2.3 From 8ac12661229501a423ade99afd6cba5a0bcb0f5a Mon Sep 17 00:00:00 2001 From: Hiroyuki Sato Date: Mon, 26 Jan 2015 13:31:12 +0900 Subject: Fix Bug#382. (Another fix). If radvd is not running, the pgrep command returns an empty string, not zero. Reported-by Carl Byington --- templates/system/ipv6/disable-forwarding/node.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'templates') diff --git a/templates/system/ipv6/disable-forwarding/node.def b/templates/system/ipv6/disable-forwarding/node.def index 5e689c5b..323b99d6 100644 --- a/templates/system/ipv6/disable-forwarding/node.def +++ b/templates/system/ipv6/disable-forwarding/node.def @@ -38,7 +38,7 @@ delete: # forwarding was disabled, we will need to start the radvd daemon # now. running=$(pgrep -n radvd) - if [[ $running -eq 0 ]] && + if [[ -z "$running" ]] && [[ -e /etc/radvd.conf ]] && [[ -x /etc/init.d/radvd ]]; then /etc/init.d/radvd start -- cgit v1.2.3 From 6ab6520391b685319f8a644aa70a03ae5902309c Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Mon, 2 Feb 2015 08:01:00 +0100 Subject: Bug #467, tos inherit not turned on by default on tunnels (IPIP, GRE) --- templates/interfaces/tunnel/node.def | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/interfaces/tunnel/node.def b/templates/interfaces/tunnel/node.def index f7ffd746..795168f6 100644 --- a/templates/interfaces/tunnel/node.def +++ b/templates/interfaces/tunnel/node.def @@ -40,6 +40,9 @@ create: echo "interfaces tunnel $VAR(@): Tunnel encapsulation type must be gre-bridge if a bridge group is defined"; exit 1; fi + if [ -z "$VAR(./parameters/ip/tos/@)" ]; then + TOS="tos inherit" + fi if [ -z "$VAR(./parameters/ip/ttl/@)" ]; then TTL="ttl 255" fi @@ -47,9 +50,9 @@ create: KEY="key $VAR(./parameters/ip/key/@)"; fi if [ "$VAR(./encapsulation/@)" == "gre" ] && [ -z $VAR(./remote-ip/) ]; then - ip tunnel add $VAR(@) local $VAR(./local-ip/@) mode gre $KEY $TTL + ip tunnel add $VAR(@) local $VAR(./local-ip/@) mode gre $KEY $TTL $TOS else - ip tunnel add $VAR(@) local $VAR(./local-ip/@) remote $VAR(./remote-ip/@) mode $VAR(./encapsulation/@) $KEY $TTL + ip tunnel add $VAR(@) local $VAR(./local-ip/@) remote $VAR(./remote-ip/@) mode $VAR(./encapsulation/@) $KEY $TTL $TOS fi if [ -z "`ip tun sh | grep $VAR(@)`" ]; then echo interfaces tunnel $VAR(@): error creating tunnel interface -- cgit v1.2.3 From d77880937b43a323a53a23c5306e88d3cfc214cb Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Thu, 5 Feb 2015 15:47:47 +0100 Subject: Bug #352 - QinQ - changing the ethertype value of vif-s --- .../interfaces/bonding/node.tag/vif-s/node.def | 16 +++++----------- .../node.tag/vif-s/node.tag/ethertype/node.def | 21 +++++++++++++++++++++ .../interfaces/ethernet/node.tag/vif-s/node.def | 17 +++++------------ .../node.tag/vif-s/node.tag/ethertype/node.def | 22 ++++++++++++++++++++++ .../pseudo-ethernet/node.tag/vif-s/node.def | 11 +++++------ .../node.tag/vif-s/node.tag/ethertype/node.def | 16 ++++++++++++++++ 6 files changed, 74 insertions(+), 29 deletions(-) create mode 100644 templates/interfaces/bonding/node.tag/vif-s/node.tag/ethertype/node.def create mode 100644 templates/interfaces/ethernet/node.tag/vif-s/node.tag/ethertype/node.def create mode 100644 templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def (limited to 'templates') diff --git a/templates/interfaces/bonding/node.tag/vif-s/node.def b/templates/interfaces/bonding/node.tag/vif-s/node.def index 5a2e8dee..dcec3900 100644 --- a/templates/interfaces/bonding/node.tag/vif-s/node.def +++ b/templates/interfaces/bonding/node.tag/vif-s/node.def @@ -5,14 +5,8 @@ help: QinQ TAG-S Virtual Local Area Network (VLAN) ID syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094" val_help: u32:0-4094; VLAN ID -create: read -a SLAVES /dev/null 2>&1 + ip link add link $VAR(../../@) name "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) || exit 1 + ip link set "$VAR(../../@).$VAR(../@)" up + /opt/vyatta/sbin/vyatta-link-detect "$VAR(../../@).$VAR(../@)" on diff --git a/templates/interfaces/ethernet/node.tag/vif-s/node.def b/templates/interfaces/ethernet/node.tag/vif-s/node.def index 0a4ed145..c6483ac0 100644 --- a/templates/interfaces/ethernet/node.tag/vif-s/node.def +++ b/templates/interfaces/ethernet/node.tag/vif-s/node.def @@ -5,15 +5,8 @@ help: QinQ TAG-S Virtual Local Area Network (VLAN) ID syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094" val_help: u32:0-4094; VLAN ID -create: if ! ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan proto 802.1ad id $VAR(@) - then echo "Error creating VLAN device $VAR(../@).$VAR(@)" - exit 1 - fi - # if parent is up, then bring VLAN up - if [ $(( $(cat /sys/class/net/$VAR(../@)/flags) & 1 )) -eq 1 ] - then ip link set "$VAR(../@).$VAR(@)" up - fi - /opt/vyatta/sbin/vyatta-link-detect "$VAR(../@).$VAR(@)" on - -delete: [ -d /sys/class/net/$VAR(../@).$VAR(@) ] || exit 0 - ip link delete dev "$VAR(../@).$VAR(@)" type vlan proto 802.1ad id $VAR(@) +delete: ETHERTYPE=`echo "$VAR(ethertype/@)"` + if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi + if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi + [ -d /sys/class/net/$VAR(../@).$VAR(@) ] || exit 0 + ip link delete dev "$VAR(../@).$VAR(@)" type vlan proto $ETHTYPE id $VAR(@) diff --git a/templates/interfaces/ethernet/node.tag/vif-s/node.tag/ethertype/node.def b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/ethertype/node.def new file mode 100644 index 00000000..9a3615be --- /dev/null +++ b/templates/interfaces/ethernet/node.tag/vif-s/node.tag/ethertype/node.def @@ -0,0 +1,22 @@ +type: txt +help: Set Ethertype +syntax:expression: $VAR(@) in "0x88A8", "0x8100";"Must be (0x88A8 0x8100)\n" +default: "0x88A8" + +comp_help: possible completions: + 0x88A8 802.1AD + 0x8100 802.1Q + +update: ETHERTYPE=`echo "$VAR(@)"` + if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi + if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi + ip link delete dev "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) > /dev/null 2>&1 + if ! ip link add link $VAR(../../@) name "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) + then echo "Error creating VLAN device $VAR(../../@).$VAR(../@)" + exit 1 + fi + # if parent is up, then bring VLAN up + if [ $(( $(cat /sys/class/net/$VAR(../../@)/flags) & 1 )) -eq 1 ] + then ip link set "$VAR(../../@).$VAR(../@)" up + fi + /opt/vyatta/sbin/vyatta-link-detect "$VAR(../../@).$VAR(../@)" on diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def index 0b867411..c4bc9577 100644 --- a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.def @@ -5,9 +5,8 @@ help: QinQ TAG-S Virtual Local Area Network (VLAN) ID syntax:expression: $VAR(@) >= 0 && $VAR(@) <= 4094; "VLAN ID must be between 0 and 4094" val_help: u32:0-4094; VLAN ID -create: ip link add link $VAR(../@) name "$VAR(../@).$VAR(@)" type vlan proto 802.1ad id $VAR(@) || exit 1 - ip link set "$VAR(../@).$VAR(@)" up - /opt/vyatta/sbin/vyatta-link-detect "$VAR(../@).$VAR(@)" on - -delete: [ -d /sys/class/net/$VAR(../@).$VAR(@) ] || exit 0 - ip link delete dev "$VAR(../@).$VAR(@)" type vlan proto 802.1ad id $VAR(@) +delete: ETHERTYPE=`echo "$VAR(ethertype/@)"` + if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi + if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi + [ -d /sys/class/net/$VAR(../@).$VAR(@) ] || exit 0 + ip link delete dev "$VAR(../@).$VAR(@)" type vlan proto $ETHTYPE id $VAR(@) diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def new file mode 100644 index 00000000..54ff166c --- /dev/null +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def @@ -0,0 +1,16 @@ +type: txt +help: Set Ethertype +syntax:expression: $VAR(@) in "0x88A8", "0x8100";"Must be (0x88A8 0x8100)\n" +default: "0x88A8" + +comp_help: possible completions: + 0x88A8 802.1AD + 0x8100 802.1Q + +update: ETHERTYPE=`echo "$VAR(@)"` + if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi + if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi + ip link delete dev "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) > /dev/null 2>&1 + ip link add link $VAR(../../@) name "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) || exit 1 + ip link set "$VAR(../../@).$VAR(../@)" up + /opt/vyatta/sbin/vyatta-link-detect "$VAR(../../@).$VAR(../@)" on -- cgit v1.2.3 From a0df6222dcf9a8d2a2d6f02b28ede4858d3a5c17 Mon Sep 17 00:00:00 2001 From: Kim Hagen Date: Fri, 6 Feb 2015 10:24:58 +0100 Subject: Can not change EtherType with vif-c interfaces configured --- .../interfaces/bonding/node.tag/vif-s/node.tag/ethertype/node.def | 7 ++++++- .../interfaces/ethernet/node.tag/vif-s/node.tag/ethertype/node.def | 7 ++++++- .../pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'templates') diff --git a/templates/interfaces/bonding/node.tag/vif-s/node.tag/ethertype/node.def b/templates/interfaces/bonding/node.tag/vif-s/node.tag/ethertype/node.def index e8a1e810..a79acae4 100644 --- a/templates/interfaces/bonding/node.tag/vif-s/node.tag/ethertype/node.def +++ b/templates/interfaces/bonding/node.tag/vif-s/node.tag/ethertype/node.def @@ -7,7 +7,12 @@ comp_help: possible completions: 0x88A8 802.1AD 0x8100 802.1Q -update: ETHERTYPE=`echo "$VAR(@)"` +update: ACTIVEETHTYPE=`cli-shell-api returnActiveValue interfaces bonding $VAR(../../@) vif-s $VAR(../@) ethertype` + if [ ! -z $VAR(../vif-c/@@) ] && [ ! -z $ACTIVEETHTYPE ] + then echo "Can not change ethertype with vif-c configured" + exit 1 + fi + ETHERTYPE=`echo "$VAR(@)"` if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi read -a SLAVES /dev/null 2>&1 diff --git a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def index 54ff166c..9e2d5a54 100644 --- a/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def +++ b/templates/interfaces/pseudo-ethernet/node.tag/vif-s/node.tag/ethertype/node.def @@ -7,7 +7,12 @@ comp_help: possible completions: 0x88A8 802.1AD 0x8100 802.1Q -update: ETHERTYPE=`echo "$VAR(@)"` +update: ACTIVEETHTYPE=`cli-shell-api returnActiveValue interfaces pseudo-ethernet $VAR(../../@) vif-s $VAR(../@) ethertype` + if [ ! -z $VAR(../vif-c/@@) ] && [ ! -z $ACTIVEETHTYPE ] + then echo "Can not change ethertype with vif-c configured" + exit 1 + fi + ETHERTYPE=`echo "$VAR(@)"` if [ $ETHERTYPE == "0x88A8" ]; then ETHTYPE=802.1ad; fi if [ $ETHERTYPE == "0x8100" ]; then ETHTYPE=802.1Q; fi ip link delete dev "$VAR(../../@).$VAR(../@)" type vlan proto $ETHTYPE id $VAR(../@) > /dev/null 2>&1 -- cgit v1.2.3 From 935deedc1499e1446fad6e153f761f11817be201 Mon Sep 17 00:00:00 2001 From: Alex Harpin Date: Sun, 8 Feb 2015 19:33:14 +0000 Subject: vyatta-cfg-system: allow dynamic dns updating from behind nat Add a couple of configuration options to DDNS, to allow the use=web option from ddclient when determining the external IP address. This will allow DDNS to be correctly updated when behind a NAT device. Syntax: set service dns dynamic interface eth0 use-web url (url to use) set service dns dynamic interface eth0 use-web skip (search for this) Bug #455 http://bugzilla.vyos.net/show_bug.cgi?id=455 --- scripts/dynamic-dns/vyatta-dynamic-dns.pl | 12 ++++++++++-- .../service/dns/dynamic/interface/node.tag/use-web/node.def | 1 + .../dns/dynamic/interface/node.tag/use-web/skip/node.def | 2 ++ .../dns/dynamic/interface/node.tag/use-web/url/node.def | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 templates/service/dns/dynamic/interface/node.tag/use-web/node.def create mode 100644 templates/service/dns/dynamic/interface/node.tag/use-web/skip/node.def create mode 100644 templates/service/dns/dynamic/interface/node.tag/use-web/url/node.def (limited to 'templates') diff --git a/scripts/dynamic-dns/vyatta-dynamic-dns.pl b/scripts/dynamic-dns/vyatta-dynamic-dns.pl index 8788730f..83206253 100755 --- a/scripts/dynamic-dns/vyatta-dynamic-dns.pl +++ b/scripts/dynamic-dns/vyatta-dynamic-dns.pl @@ -96,16 +96,24 @@ sub dynamicdns_get_constants { $output .= "ssl=yes\n"; $output .= "pid=$ddclient_run_dir/ddclient_$interface.pid\n"; $output .= "cache=$ddclient_cache_dir/ddclient_$interface.cache\n"; - $output .= "use=if, if=$interface\n\n\n"; return $output; } sub dynamicdns_get_values { - my $output = ''; + my $output; my $config = new Vyatta::Config; $config->setLevel("service dns dynamic interface $interface"); + my $web_url = $config->returnValue("use-web url"); + my $web_skip = $config->returnValue("use-web skip"); + + if ($web_url && $web_skip) { + $output = "use=web, web=$web_url, web-skip='".$web_skip."'\n\n\n"; + } else { + $output = "use=if, if=$interface\n\n\n"; + } + my @services = $config->listNodes("service"); foreach my $service (@services) { $config->setLevel("service dns dynamic interface $interface service $service"); diff --git a/templates/service/dns/dynamic/interface/node.tag/use-web/node.def b/templates/service/dns/dynamic/interface/node.tag/use-web/node.def new file mode 100644 index 00000000..f1b86b6d --- /dev/null +++ b/templates/service/dns/dynamic/interface/node.tag/use-web/node.def @@ -0,0 +1 @@ +help: Web check used for obtaining the external IP address diff --git a/templates/service/dns/dynamic/interface/node.tag/use-web/skip/node.def b/templates/service/dns/dynamic/interface/node.tag/use-web/skip/node.def new file mode 100644 index 00000000..f316a4b5 --- /dev/null +++ b/templates/service/dns/dynamic/interface/node.tag/use-web/skip/node.def @@ -0,0 +1,2 @@ +help: Skip everything before this on the given URL +type: txt diff --git a/templates/service/dns/dynamic/interface/node.tag/use-web/url/node.def b/templates/service/dns/dynamic/interface/node.tag/use-web/url/node.def new file mode 100644 index 00000000..164ddde4 --- /dev/null +++ b/templates/service/dns/dynamic/interface/node.tag/use-web/url/node.def @@ -0,0 +1,2 @@ +help: URL to obtain the current external IP address +type: txt -- cgit v1.2.3 From 93a49639c983e8f61ca942efe68ede46053ea03a Mon Sep 17 00:00:00 2001 From: Alex Harpin Date: Tue, 10 Feb 2015 22:56:06 +0000 Subject: vyatta-cfg-system: multiple servers for dns forwarding domain override When configuring DNS fowarding, allow multiple servers to be specified when setting domain overrides, in order to allow Dnsmasq to gracefully handle unavailable nameservers. Bug #408 http://bugzilla.vyos.net/show_bug.cgi?id=408 --- scripts/dns-forwarding/vyatta-dns-forwarding.pl | 25 ++++++++++++++-------- .../dns/forwarding/domain/node.tag/server/node.def | 1 + 2 files changed, 17 insertions(+), 9 deletions(-) (limited to 'templates') diff --git a/scripts/dns-forwarding/vyatta-dns-forwarding.pl b/scripts/dns-forwarding/vyatta-dns-forwarding.pl index b5efd269..217a520a 100755 --- a/scripts/dns-forwarding/vyatta-dns-forwarding.pl +++ b/scripts/dns-forwarding/vyatta-dns-forwarding.pl @@ -63,7 +63,7 @@ sub dnsforwarding_get_values { my $output = ''; my $config = new Vyatta::Config; my $use_dnsmasq_conf = 0; - my (@listen_interfaces, $cache_size, @use_nameservers, $use_system_nameservers, @use_dhcp_nameservers, @domain, $server, $ignore_hosts_file); + my (@listen_interfaces, $cache_size, @use_nameservers, $use_system_nameservers, @use_dhcp_nameservers, @domains, $server, $ignore_hosts_file); $config->setLevel("service dns forwarding"); @@ -73,7 +73,7 @@ sub dnsforwarding_get_values { @use_nameservers = $config->returnOrigValues("name-server"); $use_system_nameservers = $config->existsOrig("system"); @use_dhcp_nameservers = $config->returnOrigValues("dhcp"); - @domain = $config->listOrigNodes("domain"); + @domains = $config->listOrigNodes("domain"); $ignore_hosts_file = $config->returnOrigValue("ignore-hosts-file"); } else { @@ -82,7 +82,7 @@ sub dnsforwarding_get_values { @use_nameservers = $config->returnValues("name-server"); $use_system_nameservers = $config->exists("system"); @use_dhcp_nameservers = $config->returnValues("dhcp"); - @domain = $config->listNodes("domain"); + @domains = $config->listNodes("domain"); $ignore_hosts_file = $config->exists("ignore-hosts-file"); } @@ -112,7 +112,7 @@ sub dnsforwarding_get_values { my $sys_config = new Vyatta::Config; $sys_config->setLevel("system"); my @system_nameservers; - if ($outside_cli == 1){ + if ($outside_cli == 1) { @system_nameservers = $sys_config->returnOrigValues("name-server"); } else { @system_nameservers = $sys_config->returnValues("name-server"); @@ -123,11 +123,18 @@ sub dnsforwarding_get_values { } } } - if (@domain != 0) { - foreach my $dom (@domain) { - my $ser = $config->returnValue("domain $dom server"); - if (defined ($ser)) { - $output .="server=/$dom/$ser\t# domain-override\n"; + if (@domains != 0) { + foreach my $domain (@domains) { + my @domain_servers; + if ($outside_cli == 1) { + @domain_servers = $config->returnValues("domain $domain server"); + } else { + @domain_servers = $config->returnValues("domain $domain server"); + } + if (@domain_servers > 0) { + foreach my $domain_server (@domain_servers) { + $output .="server=/$domain/$domain_server\t# domain-override\n"; + } } } } diff --git a/templates/service/dns/forwarding/domain/node.tag/server/node.def b/templates/service/dns/forwarding/domain/node.tag/server/node.def index 3dec7d5d..8f40a299 100644 --- a/templates/service/dns/forwarding/domain/node.tag/server/node.def +++ b/templates/service/dns/forwarding/domain/node.tag/server/node.def @@ -1,2 +1,3 @@ +multi: type: ipv4 help: DNS server to forward queries -- cgit v1.2.3