When dumping to ssh via link local ipv6 address, the ssh parameter in kdump.conf is supposed to have the form like:
ssh user@fe80::cc1:8bff:fe90:b95f%eth0
where "%eth0" is an existing network interface supporting ipv6.
However, there are 4 problems in enabling link local ipv6:
1) The get_remote_host function in kdump-lib.sh currently doesn't remove the network interface in the ipv6 address, causing the ip command in kdump_install_net function to fail, leading to a "Bad kdump location" message.
2) The logic in kdump_install_net will find the network interface to use by "ip route" command, which might be different from what user specified in kdump.conf in link local ipv6 cases.
3) The kdump_setup_ifname function in dracut-module-setup.sh would add 'kdump-' prefix to network interfaces with name like 'eth*', causing ssh target specified in kdump.conf invalid while dumping process.
4) ssh target with 'kdump-' prefixed interface name is not in known_hosts while dumping, leading to ssh connection failure.
This patch series handles the problems above.
Ziyue Yang (4): dracut-module-setup.sh: change route finding logic in link local ipv6 cases dracut-module-setup.sh: add 'kdump-' prefix in kdump.conf for link local ipv6 dracut-kdump.sh: support 'kdump-' prefixed interfaces for link local ipv6 kdump.conf: add documents for link local ipv6 in ssh
dracut-kdump.sh | 10 +++++++++- dracut-module-setup.sh | 46 +++++++++++++++++++++++++++++++++++++++++----- kdump-lib.sh | 13 +++++++++++++ kdump.conf | 5 ++++- kdump.conf.5 | 7 ++++++- 5 files changed, 73 insertions(+), 8 deletions(-)
When dumping to ssh via local ipv6 address, the ssh parameter in kdump.conf is supposed to have the form like
ssh user@fe80::cc1:8bff:fe90:b95f%eth0
where "%eth0" is an existing network interface supporting ipv6.
The get_remote_host function in kdump-lib.sh currently doesn't remove the network interface in the link local ipv6 addresses, causing the ip command in kdump_install_net function to fail, leading to a "Bad kdump location" message.
Meanwhile, current logic in kdump_install_net will find the network interface to use by "ip route" command, which might be different from what user specified in kdump.conf in link local ipv6 cases.
This commit 1) adds a helper function is_ipv6_link_local to find out whether a host is a link local ipv6 address. 2) changes logic in kdump_install_net to get rid of ifname for link local ipv6 before ip command, and use network interface specified in link local ipv6 cases.
Signed-off-by: Ziyue Yang ziyang@redhat.com --- dracut-module-setup.sh | 19 ++++++++++++++----- kdump-lib.sh | 5 +++++ 2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index ae13337..97155b6 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -341,12 +341,21 @@ kdump_install_net() { _server=`echo $_serv_tmp | cut -d' ' -f1` fi
- _route=`/sbin/ip -o route get to $_server 2>&1` - [ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1 + if is_ipv6_link_local $_server; then + # use network interface specified by link local address + _netdev=${_server##*%} + _server=${_server%%*} + _route=$(/sbin/ip -o route get to $_server dev $_netdev 2>&1) + [ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1 + _srcaddr=$(get_ip_route_field "$_route" "src") + else + _route=$(/sbin/ip -o route get to $_server 2>&1) + [ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1
- #the field in the ip output changes if we go to another subnet - _srcaddr=$(get_ip_route_field "$_route" "src") - _netdev=$(get_ip_route_field "$_route" "dev") + #the field in the ip output changes if we go to another subnet + _srcaddr=$(get_ip_route_field "$_route" "src") + _netdev=$(get_ip_route_field "$_route" "dev") + fi
kdump_setup_netdev "${_netdev}" "${_srcaddr}"
diff --git a/kdump-lib.sh b/kdump-lib.sh index 3f0af91..fb3e354 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -312,6 +312,11 @@ is_ipv6_address() echo $1 | grep -q ":" }
+is_ipv6_link_local() +{ + echo $1 | grep -q "^fe80::" +} + # get ip address or hostname from nfs/ssh config value get_remote_host() {
Hi, On 08/25/17 at 03:34pm, Ziyue Yang wrote:
When dumping to ssh via local ipv6 address, the ssh parameter in kdump.conf is supposed to have the form like
ssh user@fe80::cc1:8bff:fe90:b95f%eth0
where "%eth0" is an existing network interface supporting ipv6.
The get_remote_host function in kdump-lib.sh currently doesn't remove the network interface in the link local ipv6 addresses, causing the ip command in kdump_install_net function to fail, leading to a "Bad kdump location" message.
Meanwhile, current logic in kdump_install_net will find the network interface to use by "ip route" command, which might be different from what user specified in kdump.conf in link local ipv6 cases.
This commit
- adds a helper function is_ipv6_link_local to find out
whether a host is a link local ipv6 address. 2) changes logic in kdump_install_net to get rid of ifname for link local ipv6 before ip command, and use network interface specified in link local ipv6 cases.
Signed-off-by: Ziyue Yang ziyang@redhat.com
dracut-module-setup.sh | 19 ++++++++++++++----- kdump-lib.sh | 5 +++++ 2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index ae13337..97155b6 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -341,12 +341,21 @@ kdump_install_net() { _server=`echo $_serv_tmp | cut -d' ' -f1` fi
- _route=`/sbin/ip -o route get to $_server 2>&1`
- [ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1
- if is_ipv6_link_local $_server; then
# use network interface specified by link local address
_netdev=${_server##*\%}
_server=${_server%\%*}
_route=$(/sbin/ip -o route get to $_server dev $_netdev 2>&1)
[ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1
_srcaddr=$(get_ip_route_field "$_route" "src")
- else
_route=$(/sbin/ip -o route get to $_server 2>&1)
[ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1
- #the field in the ip output changes if we go to another subnet
- _srcaddr=$(get_ip_route_field "$_route" "src")
- _netdev=$(get_ip_route_field "$_route" "dev")
#the field in the ip output changes if we go to another subnet
_srcaddr=$(get_ip_route_field "$_route" "src")
_netdev=$(get_ip_route_field "$_route" "dev")
fi
kdump_setup_netdev "${_netdev}" "${_srcaddr}"
diff --git a/kdump-lib.sh b/kdump-lib.sh index 3f0af91..fb3e354 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -312,6 +312,11 @@ is_ipv6_address() echo $1 | grep -q ":" }
+is_ipv6_link_local() +{
- echo $1 | grep -q "^fe80::"
+}
# get ip address or hostname from nfs/ssh config value get_remote_host() { -- 2.9.3 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
There's other ip route code path, please update them as well. like: kdump_setup_iscsi_device()
kdump_static_ip maybe do not need update, I'm not sure, please carefully check it as well.
Thanks Dave
Hi,
On Fri, Sep 1, 2017 at 11:06 AM, Dave Young dyoung@redhat.com wrote:
Hi, On 08/25/17 at 03:34pm, Ziyue Yang wrote:
When dumping to ssh via local ipv6 address, the ssh parameter in kdump.conf is supposed to have the form like
ssh user@fe80::cc1:8bff:fe90:b95f%eth0
where "%eth0" is an existing network interface supporting ipv6.
The get_remote_host function in kdump-lib.sh currently doesn't remove the network interface in the link local ipv6 addresses, causing the ip command in kdump_install_net function to fail, leading to a "Bad kdump location" message.
Meanwhile, current logic in kdump_install_net will find the network interface to use by "ip route" command, which might be different from what user specified in kdump.conf in link local ipv6 cases.
This commit
- adds a helper function is_ipv6_link_local to find out
whether a host is a link local ipv6 address. 2) changes logic in kdump_install_net to get rid of ifname for link local ipv6 before ip command, and use network interface specified in link local ipv6 cases.
Signed-off-by: Ziyue Yang ziyang@redhat.com
dracut-module-setup.sh | 19 ++++++++++++++----- kdump-lib.sh | 5 +++++ 2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index ae13337..97155b6 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -341,12 +341,21 @@ kdump_install_net() { _server=`echo $_serv_tmp | cut -d' ' -f1` fi
- _route=`/sbin/ip -o route get to $_server 2>&1`
- [ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1
- if is_ipv6_link_local $_server; then
# use network interface specified by link local address
_netdev=${_server##*\%}
_server=${_server%\%*}
_route=$(/sbin/ip -o route get to $_server dev $_netdev 2>&1)
[ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1
_srcaddr=$(get_ip_route_field "$_route" "src")
- else
_route=$(/sbin/ip -o route get to $_server 2>&1)
[ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1
- #the field in the ip output changes if we go to another subnet
- _srcaddr=$(get_ip_route_field "$_route" "src")
- _netdev=$(get_ip_route_field "$_route" "dev")
#the field in the ip output changes if we go to another subnet
_srcaddr=$(get_ip_route_field "$_route" "src")
_netdev=$(get_ip_route_field "$_route" "dev")
fi
kdump_setup_netdev "${_netdev}" "${_srcaddr}"
diff --git a/kdump-lib.sh b/kdump-lib.sh index 3f0af91..fb3e354 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -312,6 +312,11 @@ is_ipv6_address() echo $1 | grep -q ":" }
+is_ipv6_link_local() +{
- echo $1 | grep -q "^fe80::"
+}
# get ip address or hostname from nfs/ssh config value get_remote_host() { -- 2.9.3 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
There's other ip route code path, please update them as well. like: kdump_setup_iscsi_device()
kdump_static_ip maybe do not need update, I'm not sure, please carefully check it as well.
Updates of route paths in kdump_static_ip and kdump_setup_iscsi_device may not be tested well, for currently I'm working for the ssh case only..this might cause the patch too long as well. What about forming these updates in another patch series, once the is_ipv6_link_local function is acked and merged?
Thanks Dave
Thanks
Hi Ziyue, On 09/01/17 at 12:26pm, Ziyue Yang wrote:
Hi,
On Fri, Sep 1, 2017 at 11:06 AM, Dave Young dyoung@redhat.com wrote:
Hi, On 08/25/17 at 03:34pm, Ziyue Yang wrote:
When dumping to ssh via local ipv6 address, the ssh parameter in kdump.conf is supposed to have the form like
ssh user@fe80::cc1:8bff:fe90:b95f%eth0
where "%eth0" is an existing network interface supporting ipv6.
The get_remote_host function in kdump-lib.sh currently doesn't remove the network interface in the link local ipv6 addresses, causing the ip command in kdump_install_net function to fail, leading to a "Bad kdump location" message.
Meanwhile, current logic in kdump_install_net will find the network interface to use by "ip route" command, which might be different from what user specified in kdump.conf in link local ipv6 cases.
This commit
- adds a helper function is_ipv6_link_local to find out
whether a host is a link local ipv6 address. 2) changes logic in kdump_install_net to get rid of ifname for link local ipv6 before ip command, and use network interface specified in link local ipv6 cases.
Signed-off-by: Ziyue Yang ziyang@redhat.com
dracut-module-setup.sh | 19 ++++++++++++++----- kdump-lib.sh | 5 +++++ 2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index ae13337..97155b6 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -341,12 +341,21 @@ kdump_install_net() { _server=`echo $_serv_tmp | cut -d' ' -f1` fi
- _route=`/sbin/ip -o route get to $_server 2>&1`
- [ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1
- if is_ipv6_link_local $_server; then
# use network interface specified by link local address
_netdev=${_server##*\%}
_server=${_server%\%*}
_route=$(/sbin/ip -o route get to $_server dev $_netdev 2>&1)
[ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1
_srcaddr=$(get_ip_route_field "$_route" "src")
- else
_route=$(/sbin/ip -o route get to $_server 2>&1)
[ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1
- #the field in the ip output changes if we go to another subnet
- _srcaddr=$(get_ip_route_field "$_route" "src")
- _netdev=$(get_ip_route_field "$_route" "dev")
#the field in the ip output changes if we go to another subnet
_srcaddr=$(get_ip_route_field "$_route" "src")
_netdev=$(get_ip_route_field "$_route" "dev")
fi
kdump_setup_netdev "${_netdev}" "${_srcaddr}"
diff --git a/kdump-lib.sh b/kdump-lib.sh index 3f0af91..fb3e354 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -312,6 +312,11 @@ is_ipv6_address() echo $1 | grep -q ":" }
+is_ipv6_link_local() +{
- echo $1 | grep -q "^fe80::"
+}
# get ip address or hostname from nfs/ssh config value get_remote_host() { -- 2.9.3 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
There's other ip route code path, please update them as well. like: kdump_setup_iscsi_device()
kdump_static_ip maybe do not need update, I'm not sure, please carefully check it as well.
Updates of route paths in kdump_static_ip and kdump_setup_iscsi_device may not be tested well, for currently I'm working for the ssh case only..this might cause the patch too long as well. What about forming these updates in another patch series, once the is_ipv6_link_local function is acked and merged?
We'd better to solve all of these in one patch serie. For static ip it might be not necessary according to discussion previously from Baoquan and Pingfan, but I'm not sure. Even if we do not need change them I'm not sure if we should skip the case somewhere or not..
Thanks Dave
Thanks
Thanks Dave
Hi,
On Fri, Sep 1, 2017 at 1:30 PM, Dave Young dyoung@redhat.com wrote:
Hi Ziyue, On 09/01/17 at 12:26pm, Ziyue Yang wrote:
Hi,
On Fri, Sep 1, 2017 at 11:06 AM, Dave Young dyoung@redhat.com wrote:
Hi, On 08/25/17 at 03:34pm, Ziyue Yang wrote:
When dumping to ssh via local ipv6 address, the ssh parameter in kdump.conf is supposed to have the form like
ssh user@fe80::cc1:8bff:fe90:b95f%eth0
where "%eth0" is an existing network interface supporting ipv6.
The get_remote_host function in kdump-lib.sh currently doesn't remove the network interface in the link local ipv6 addresses, causing the ip command in kdump_install_net function to fail, leading to a "Bad kdump location" message.
Meanwhile, current logic in kdump_install_net will find the network interface to use by "ip route" command, which might be different from what user specified in kdump.conf in link local ipv6 cases.
This commit
- adds a helper function is_ipv6_link_local to find out
whether a host is a link local ipv6 address. 2) changes logic in kdump_install_net to get rid of ifname for link local ipv6 before ip command, and use network interface specified in link local ipv6 cases.
Signed-off-by: Ziyue Yang ziyang@redhat.com
dracut-module-setup.sh | 19 ++++++++++++++----- kdump-lib.sh | 5 +++++ 2 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index ae13337..97155b6 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -341,12 +341,21 @@ kdump_install_net() { _server=`echo $_serv_tmp | cut -d' ' -f1` fi
- _route=`/sbin/ip -o route get to $_server 2>&1`
- [ $? != 0 ] && echo "Bad kdump location: $config_val" && exit 1
- if is_ipv6_link_local $_server; then
# use network interface specified by link local address
_netdev=${_server##*\%}
_server=${_server%\%*}
_route=$(/sbin/ip -o route get to $_server dev $_netdev
2>&1)
[ $? != 0 ] && echo "Bad kdump location: $config_val" &&
exit 1
_srcaddr=$(get_ip_route_field "$_route" "src")
- else
_route=$(/sbin/ip -o route get to $_server 2>&1)
[ $? != 0 ] && echo "Bad kdump location: $config_val" &&
exit 1
- #the field in the ip output changes if we go to another subnet
- _srcaddr=$(get_ip_route_field "$_route" "src")
- _netdev=$(get_ip_route_field "$_route" "dev")
#the field in the ip output changes if we go to another
subnet
_srcaddr=$(get_ip_route_field "$_route" "src")
_netdev=$(get_ip_route_field "$_route" "dev")
fi
kdump_setup_netdev "${_netdev}" "${_srcaddr}"
diff --git a/kdump-lib.sh b/kdump-lib.sh index 3f0af91..fb3e354 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -312,6 +312,11 @@ is_ipv6_address() echo $1 | grep -q ":" }
+is_ipv6_link_local() +{
- echo $1 | grep -q "^fe80::"
+}
# get ip address or hostname from nfs/ssh config value get_remote_host() { -- 2.9.3 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
There's other ip route code path, please update them as well. like: kdump_setup_iscsi_device()
kdump_static_ip maybe do not need update, I'm not sure, please
carefully
check it as well.
Updates of route paths in kdump_static_ip and kdump_setup_iscsi_device
may
not be tested well, for currently I'm working for the ssh case only..this might cause the patch too long as well. What about forming these updates
in
another patch series, once the is_ipv6_link_local function is acked and merged?
We'd better to solve all of these in one patch serie. For static ip it might be not necessary according to discussion previously from Baoquan and Pingfan, but I'm not sure. Even if we do not need change them I'm not sure if we should skip the case somewhere or not..
Just confirmed that kdump_static_ip doesn't need any modification, as
Baoquan and Pingfan said. As for the iscsi function, I'll build a soft iscsi server to check it out later.
Thanks Dave
Thanks
Thanks Dave
Thanks
Currently the kdump_setup_ifname function would not add 'kdump-' prefix to ssh target specified in link local ipv6 cases, causing ssh dumping failed.
This commit makes kdump_setup_ifname add 'kdump-' prefix to the ssh target specified in kdump.conf in link local ipv6 address cases.
Signed-off-by: Ziyue Yang ziyang@redhat.com --- dracut-module-setup.sh | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 97155b6..597d4a4 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -167,6 +167,7 @@ kdump_setup_ifname() { # 'kdump-' is already persistent, this should be fine. if [[ $1 =~ eth* ]] && [[ ! $1 =~ ^kdump-* ]]; then _ifname="kdump-$1" + kdump_setup_ipv6_link_local_ifname "ssh" $1 $_ifname else _ifname="$1" fi @@ -174,6 +175,32 @@ kdump_setup_ifname() { echo "$_ifname" }
+# Set ifname in network dumping targets to a specified one +# in link local ipv6 cases +# $1: kdump.conf's config item name +# $2: interface name to change +# $3: interface name to assign +kdump_setup_ipv6_link_local_ifname() +{ + local _config_item=$1 + local _ifname=$2 + local _new_ifname=$3 + + local _target=$(get_option_value $_config_item) + [[ -n $_target ]] && { + local _host=$(get_remote_host $_target) + if is_ipv6_link_local "$_host"; then + local _target_prefix=${_target%%*} + local _target_postfix=${_target##*%} + if [[ $_target_postfix == $_ifname ]]; then + _new_target="$_target_prefix%$_new_ifname" + sed -i "/^$_config_item\ /d" ${initdir}/tmp/$$-kdump.conf + echo "$_config_item $_new_target" >> ${initdir}/tmp/$$-kdump.conf + fi + fi + } +} + kdump_setup_bridge() { local _netdev=$1 local _brif _dev _mac _kdumpdev
ssh target of link local ipv6 might have network interface name prefixed by 'kdump-', which is not in known_hosts while dumping, leading to failure in dump_ssh.
This commit 1) adds a helper function is_ipv6_link_local_ifname_prefixed to find out whether a host is a link local ipv6 address with 'kdump-' prefixed ifname; 2) makes dump_ssh cancel 'StrictHostKeyChecking' for link local ipv6 address cases in order to bypass the known_hosts, for it's not possible to add 'kdump-' variants in hashed known_hosts if there is any need.
Signed-off-by: Ziyue Yang ziyang@redhat.com --- dracut-kdump.sh | 10 +++++++++- kdump-lib.sh | 8 ++++++++ 2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh index b75c2a5..2c32e4e 100755 --- a/dracut-kdump.sh +++ b/dracut-kdump.sh @@ -71,10 +71,18 @@ dump_raw()
dump_ssh() { - local _opt="-i $1 -o BatchMode=yes -o StrictHostKeyChecking=yes" + local _opt="-i $1 -o BatchMode=yes" local _dir="$KDUMP_PATH/$HOST_IP-$DATEDIR" local _host=$2
+ # cancel HostKeyChecking for link-local ipv6 address + # with "kdump-" prefixed interface name + if is_ipv6_link_local_ifname_prefixed $(get_remote_host $_host); then + _opt+=" -o StrictHostKeyChecking=no" + else + _opt+=" -o StrictHostKeyChecking=yes" + fi + echo "kdump: saving to $_host:$_dir"
cat /var/lib/random-seed > /dev/urandom diff --git a/kdump-lib.sh b/kdump-lib.sh index fb3e354..06548fe 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -317,6 +317,14 @@ is_ipv6_link_local() echo $1 | grep -q "^fe80::" }
+is_ipv6_link_local_ifname_prefixed() +{ + is_ipv6_link_local $1 && { + local _postfix=${1##*%} + echo $_postfix | grep -q "^kdump-" + } +} + # get ip address or hostname from nfs/ssh config value get_remote_host() {
When dumping to ssh via local ipv6 address, the ssh parameter in kdump.conf is supposed to have the form like
ssh user@fe80::cc1:8bff:fe90:b95f%eth0
where "%eth0" is an existing network interface supporting ipv6.
This commit adds documents about ssh target format in kdump.conf and kdump.conf.5.
Signed-off-by: Ziyue Yang ziyang@redhat.com --- kdump.conf | 5 ++++- kdump.conf.5 | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/kdump.conf b/kdump.conf index 57af7b6..7f7566d 100644 --- a/kdump.conf +++ b/kdump.conf @@ -23,7 +23,10 @@ # ssh user@server # - Will scp /proc/vmcore to user@server:<path>/%HOST-%DATE/, # supports DNS. -# NOTE: make sure the user has write permissions on the server. +# NOTE: +# 1) Make sure the user has write permissions on the server. +# 2) For link local ipv6 addresses, network interface name is +# needed, like user@fe80::1%eth0:/var/crash/. # # sshkey <path> # - Will use the sshkey to do ssh dump. diff --git a/kdump.conf.5 b/kdump.conf.5 index 11b1fad..720d55f 100644 --- a/kdump.conf.5 +++ b/kdump.conf.5 @@ -42,8 +42,13 @@ mount point. .B ssh user@server .RS Will scp /proc/vmcore to user@server:<path>/%HOST-%DATE/, -supports DNS. NOTE: make sure user has necessary write permissions on +supports DNS. +.PP +Note 1: make sure user has necessary write permissions on server and that a fqdn is used as the server name. +.PP +Note 2: for link local ipv6 addresses, network interface name is +needed in server field, like user@fe80::1%eth0:/var/crash/. .RE
.B sshkey <path>
On 08/25/17 at 03:34pm, Ziyue Yang wrote:
When dumping to ssh via local ipv6 address, the ssh parameter in kdump.conf is supposed to have the form like
ssh user@fe80::cc1:8bff:fe90:b95f%eth0
where "%eth0" is an existing network interface supporting ipv6.
This commit adds documents about ssh target format in kdump.conf and kdump.conf.5.
Signed-off-by: Ziyue Yang ziyang@redhat.com
kdump.conf | 5 ++++- kdump.conf.5 | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/kdump.conf b/kdump.conf index 57af7b6..7f7566d 100644 --- a/kdump.conf +++ b/kdump.conf @@ -23,7 +23,10 @@ # ssh user@server # - Will scp /proc/vmcore to user@server:<path>/%HOST-%DATE/, # supports DNS. -# NOTE: make sure the user has write permissions on the server. +# NOTE: +# 1) Make sure the user has write permissions on the server. +# 2) For link local ipv6 addresses, network interface name is +# needed, like user@fe80::1%eth0:/var/crash/.
Isn't this standard, do we need explictly say it in documentation?
# # sshkey <path> # - Will use the sshkey to do ssh dump. diff --git a/kdump.conf.5 b/kdump.conf.5 index 11b1fad..720d55f 100644 --- a/kdump.conf.5 +++ b/kdump.conf.5 @@ -42,8 +42,13 @@ mount point. .B ssh user@server .RS Will scp /proc/vmcore to user@server:<path>/%HOST-%DATE/, -supports DNS. NOTE: make sure user has necessary write permissions on +supports DNS. +.PP +Note 1: make sure user has necessary write permissions on server and that a fqdn is used as the server name. +.PP +Note 2: for link local ipv6 addresses, network interface name is +needed in server field, like user@fe80::1%eth0:/var/crash/. .RE
.B sshkey <path>
2.9.3 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Thanks Dave
Hi,
On Fri, Sep 1, 2017 at 11:08 AM, Dave Young dyoung@redhat.com wrote:
On 08/25/17 at 03:34pm, Ziyue Yang wrote:
When dumping to ssh via local ipv6 address, the ssh parameter in kdump.conf is supposed to have the form like
ssh user@fe80::cc1:8bff:fe90:b95f%eth0
where "%eth0" is an existing network interface supporting ipv6.
This commit adds documents about ssh target format in kdump.conf and kdump.conf.5.
Signed-off-by: Ziyue Yang ziyang@redhat.com
kdump.conf | 5 ++++- kdump.conf.5 | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/kdump.conf b/kdump.conf index 57af7b6..7f7566d 100644 --- a/kdump.conf +++ b/kdump.conf @@ -23,7 +23,10 @@ # ssh user@server # - Will scp /proc/vmcore to user@server:<path>/%HOST-%
DATE/,
# supports DNS. -# NOTE: make sure the user has write permissions on the
server.
+# NOTE: +# 1) Make sure the user has write permissions on the server. +# 2) For link local ipv6 addresses, network interface name
is
+# needed, like user@fe80::1%eth0:/var/crash/.
Isn't this standard, do we need explictly say it in documentation?
The ipv6 format in ssh is different from the one in nfs, like user@fe80::1%eth0 and [fe80::1%eth0]:/nfs/
Maybe there is a need? I'm not sure.
# # sshkey <path> # - Will use the sshkey to do ssh dump. diff --git a/kdump.conf.5 b/kdump.conf.5 index 11b1fad..720d55f 100644 --- a/kdump.conf.5 +++ b/kdump.conf.5 @@ -42,8 +42,13 @@ mount point. .B ssh user@server .RS Will scp /proc/vmcore to user@server:<path>/%HOST-%DATE/, -supports DNS. NOTE: make sure user has necessary write permissions on +supports DNS. +.PP +Note 1: make sure user has necessary write permissions on server and that a fqdn is used as the server name. +.PP +Note 2: for link local ipv6 addresses, network interface name is +needed in server field, like user@fe80::1%eth0:/var/crash/. .RE
.B sshkey <path>
2.9.3 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Thanks Dave
Thanks
Hi, On 09/01/17 at 12:37pm, Ziyue Yang wrote:
Hi,
On Fri, Sep 1, 2017 at 11:08 AM, Dave Young dyoung@redhat.com wrote:
On 08/25/17 at 03:34pm, Ziyue Yang wrote:
When dumping to ssh via local ipv6 address, the ssh parameter in kdump.conf is supposed to have the form like
ssh user@fe80::cc1:8bff:fe90:b95f%eth0
where "%eth0" is an existing network interface supporting ipv6.
This commit adds documents about ssh target format in kdump.conf and kdump.conf.5.
Signed-off-by: Ziyue Yang ziyang@redhat.com
kdump.conf | 5 ++++- kdump.conf.5 | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/kdump.conf b/kdump.conf index 57af7b6..7f7566d 100644 --- a/kdump.conf +++ b/kdump.conf @@ -23,7 +23,10 @@ # ssh user@server # - Will scp /proc/vmcore to user@server:<path>/%HOST-%
DATE/,
# supports DNS. -# NOTE: make sure the user has write permissions on the
server.
+# NOTE: +# 1) Make sure the user has write permissions on the server. +# 2) For link local ipv6 addresses, network interface name
is
+# needed, like user@fe80::1%eth0:/var/crash/.
Isn't this standard, do we need explictly say it in documentation?
The ipv6 format in ssh is different from the one in nfs, like user@fe80::1%eth0 and [fe80::1%eth0]:/nfs/
Maybe there is a need? I'm not sure.
For anyone who want use them, not only for kdump, it should be a convention, we do not need to tell people how to do it in kdump document.
# # sshkey <path> # - Will use the sshkey to do ssh dump. diff --git a/kdump.conf.5 b/kdump.conf.5 index 11b1fad..720d55f 100644 --- a/kdump.conf.5 +++ b/kdump.conf.5 @@ -42,8 +42,13 @@ mount point. .B ssh user@server .RS Will scp /proc/vmcore to user@server:<path>/%HOST-%DATE/, -supports DNS. NOTE: make sure user has necessary write permissions on +supports DNS. +.PP +Note 1: make sure user has necessary write permissions on server and that a fqdn is used as the server name. +.PP +Note 2: for link local ipv6 addresses, network interface name is +needed in server field, like user@fe80::1%eth0:/var/crash/. .RE
.B sshkey <path>
2.9.3 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Thanks Dave
Thanks
Thanks Dave
----- Original Message -----
From: "Ziyue Yang" ziyang@redhat.com To: kexec@lists.fedoraproject.org Cc: "Ziyue Yang" ziyang@redhat.com Sent: Friday, August 25, 2017 3:34:23 PM Subject: [PATCH v8 0/4] support dump ssh via link local ipv6 address
When dumping to ssh via link local ipv6 address, the ssh parameter in kdump.conf is supposed to have the form like:
ssh user@fe80::cc1:8bff:fe90:b95f%eth0
where "%eth0" is an existing network interface supporting ipv6.
However, there are 4 problems in enabling link local ipv6:
- The get_remote_host function in kdump-lib.sh currently
doesn't remove the network interface in the ipv6 address, causing the ip command in kdump_install_net function to fail, leading to a "Bad kdump location" message.
- The logic in kdump_install_net will find the network
interface to use by "ip route" command, which might be different from what user specified in kdump.conf in link local ipv6 cases.
- The kdump_setup_ifname function in dracut-module-setup.sh
would add 'kdump-' prefix to network interfaces with name like 'eth*', causing ssh target specified in kdump.conf invalid while dumping process.
- ssh target with 'kdump-' prefixed interface name is not
in known_hosts while dumping, leading to ssh connection failure.
This patch series handles the problems above.
Ziyue Yang (4): dracut-module-setup.sh: change route finding logic in link local ipv6 cases dracut-module-setup.sh: add 'kdump-' prefix in kdump.conf for link local ipv6 dracut-kdump.sh: support 'kdump-' prefixed interfaces for link local ipv6 kdump.conf: add documents for link local ipv6 in ssh
dracut-kdump.sh | 10 +++++++++- dracut-module-setup.sh | 46 +++++++++++++++++++++++++++++++++++++++++----- kdump-lib.sh | 13 +++++++++++++ kdump.conf | 5 ++++- kdump.conf.5 | 7 ++++++- 5 files changed, 73 insertions(+), 8 deletions(-)
--
The patch 4/4 for document can not be applied on master. Otherwise it works fine.
Thanks, Pingfan