From ca1caa6c6effb82b22dad0db4c4f47247c3722ad Mon Sep 17 00:00:00 2001 From: Dmytro Aleksandrov Date: Thu, 22 Aug 2019 17:26:30 +0300 Subject: [op-mode] T1607 rewrite 'reset conntrack', 'reset & show ip[v6]' to python/xml syntax --- op-mode-definitions/dns-forwarding.xml | 3 + op-mode-definitions/ipv4-route.xml | 125 ++++++++++++++++++++++++++++++ op-mode-definitions/ipv6-route.xml | 133 ++++++++++++++++++++++++++++++++ op-mode-definitions/openvpn.xml | 3 + op-mode-definitions/reset-conntrack.xml | 16 ++++ 5 files changed, 280 insertions(+) create mode 100644 op-mode-definitions/ipv4-route.xml create mode 100644 op-mode-definitions/ipv6-route.xml create mode 100644 op-mode-definitions/reset-conntrack.xml (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/dns-forwarding.xml b/op-mode-definitions/dns-forwarding.xml index ac141174f..785a05e9c 100644 --- a/op-mode-definitions/dns-forwarding.xml +++ b/op-mode-definitions/dns-forwarding.xml @@ -42,6 +42,9 @@ + + Reset a service + diff --git a/op-mode-definitions/ipv4-route.xml b/op-mode-definitions/ipv4-route.xml new file mode 100644 index 000000000..d2846a6f2 --- /dev/null +++ b/op-mode-definitions/ipv4-route.xml @@ -0,0 +1,125 @@ + + + + + Show system information + + + + + Show IPv4 information + + + + + Show IP multicast group membership + + netstat -gn4 + + + + + Show IP routes + + + + + Show kernel route cache + + ip -s route list cache + + + + Show kernel route cache for a given route + + <x.x.x.x> <x.x.x.x/x> + + + ip -s route list cache $5 + + + + Show kernel route table + + ip route list + + + + Show kernel route table for a given route + + <x.x.x.x> <x.x.x.x/x> + + + ip -s route list $5 + + + + + + + + + + + Reset a service + + + + + Reset Internet Protocol (IP) parameters + + + + + Reset Address Resolution Protocol (ARP) cache + + + + + Reset ARP cache for an IPv4 address + + <x.x.x.x> + + + sudo /sbin/ip neigh flush to "$5" + + + + Reset ARP cache for interface + + + + + sudo /sbin/ip neigh flush dev "$5" + + + + + + + Reset IP route + + + + + Flush the kernel route cache + + sudo /sbin/ip route flush cache + + + + + Flush the kernel route cache for a given route + + <x.x.x.x> <x.x.x.x/x> + + + sudo /sbin/ip route flush cache "$5" + + + + + + + + diff --git a/op-mode-definitions/ipv6-route.xml b/op-mode-definitions/ipv6-route.xml new file mode 100644 index 000000000..fbf6489ba --- /dev/null +++ b/op-mode-definitions/ipv6-route.xml @@ -0,0 +1,133 @@ + + + + + Show system information + + + + + Show IPv6 routing information + + + + + Show IPv6 multicast group membership + + netstat -gn6 + + + + + Show IPv6 Neighbor Discovery (ND) information + + ip -f inet6 neigh list + + + + + Show IPv6 routes + + + + + Show kernel IPv6 route cache + + ip -s -f inet6 route list cache + + + + Show kernel IPv6 route cache for a given route + + <h:h:h:h:h:h:h:h> <h:h:h:h:h:h:h:h/x> + + + ip -s -f inet6 route list cache $5 + + + + Show kernel IPv6 route table + + ip -f inet6 route list + + + + Show kernel IPv6 route table for a given route + + <h:h:h:h:h:h:h:h> <h:h:h:h:h:h:h:h/x> + + + ip -s -f inet6 route list $5 + + + + + + + + + + + + Reset a service + + + + + Reset Internet Protocol version 6 (IPv6) parameters + + + + + Reset IPv6 Neighbor Discovery (ND) cache + + + + + Reset ND cache for an IPv6 address + + <h:h:h:h:h:h:h:h> + + + sudo ip -f inet6 neigh flush to "$5" + + + + Reset IPv6 ND cache for interface + + + + + sudo ip -f inet6 neigh flush dev "$5" + + + + + + + Reset IPv6 route + + + + + Flush the kernel IPv6 route cache + + sudo ip -f inet6 route flush cache + + + + + Flush the kernel IPv6 route cache for a given route + + <h:h:h:h:h:h:h:h> <h:h:h:h:h:h:h:h/x> + + + sudo ip -f inet6 route flush cache "$5" + + + + + + + + diff --git a/op-mode-definitions/openvpn.xml b/op-mode-definitions/openvpn.xml index 4c958257a..ac0c42789 100644 --- a/op-mode-definitions/openvpn.xml +++ b/op-mode-definitions/openvpn.xml @@ -46,6 +46,9 @@ + + Reset a service + diff --git a/op-mode-definitions/reset-conntrack.xml b/op-mode-definitions/reset-conntrack.xml new file mode 100644 index 000000000..827ba4af4 --- /dev/null +++ b/op-mode-definitions/reset-conntrack.xml @@ -0,0 +1,16 @@ + + + + + Reset a service + + + + + Reset all currently tracked connections + + sudo ${vyos_op_scripts_dir}/clear_conntrack.py + + + + -- cgit v1.2.3