Exclude interface when send ICMP ping
up vote
0
down vote
favorite
for build small linux application I need to check the internet connectivity of the system. But my box have multiple network interfaces with interfaced for backup internet connection. I need to do some task based on main network connection lose the connectivity.
I used to chose interface using -i with ping command
ping -I eth0 x.x.x.x
but with this method i have to mention all the available interfaces on my application. Other than doing this is there any way to do something like this
ping -I !bkp0 x.x.x.x
basically I need to check the connectivity of all the links except backup link
network-interface ping icmp
add a comment |
up vote
0
down vote
favorite
for build small linux application I need to check the internet connectivity of the system. But my box have multiple network interfaces with interfaced for backup internet connection. I need to do some task based on main network connection lose the connectivity.
I used to chose interface using -i with ping command
ping -I eth0 x.x.x.x
but with this method i have to mention all the available interfaces on my application. Other than doing this is there any way to do something like this
ping -I !bkp0 x.x.x.x
basically I need to check the connectivity of all the links except backup link
network-interface ping icmp
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
for build small linux application I need to check the internet connectivity of the system. But my box have multiple network interfaces with interfaced for backup internet connection. I need to do some task based on main network connection lose the connectivity.
I used to chose interface using -i with ping command
ping -I eth0 x.x.x.x
but with this method i have to mention all the available interfaces on my application. Other than doing this is there any way to do something like this
ping -I !bkp0 x.x.x.x
basically I need to check the connectivity of all the links except backup link
network-interface ping icmp
for build small linux application I need to check the internet connectivity of the system. But my box have multiple network interfaces with interfaced for backup internet connection. I need to do some task based on main network connection lose the connectivity.
I used to chose interface using -i with ping command
ping -I eth0 x.x.x.x
but with this method i have to mention all the available interfaces on my application. Other than doing this is there any way to do something like this
ping -I !bkp0 x.x.x.x
basically I need to check the connectivity of all the links except backup link
network-interface ping icmp
network-interface ping icmp
edited 2 days ago
Jeff Schaller
35.8k952119
35.8k952119
asked 2 days ago
gripen fighter
182110
182110
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
Do you just need one to work to call it "good"? If you need to check the connectivity for all of the interfaces except one, and you know the name of the interface, you could script it:
for i in `ip -br link | cut -d" " -f1`
do
if [ ${i} != "bkp0" ]
then
ping -c 1 -I ${i} so.me.add.ress
fi
done
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
Do you just need one to work to call it "good"? If you need to check the connectivity for all of the interfaces except one, and you know the name of the interface, you could script it:
for i in `ip -br link | cut -d" " -f1`
do
if [ ${i} != "bkp0" ]
then
ping -c 1 -I ${i} so.me.add.ress
fi
done
add a comment |
up vote
1
down vote
Do you just need one to work to call it "good"? If you need to check the connectivity for all of the interfaces except one, and you know the name of the interface, you could script it:
for i in `ip -br link | cut -d" " -f1`
do
if [ ${i} != "bkp0" ]
then
ping -c 1 -I ${i} so.me.add.ress
fi
done
add a comment |
up vote
1
down vote
up vote
1
down vote
Do you just need one to work to call it "good"? If you need to check the connectivity for all of the interfaces except one, and you know the name of the interface, you could script it:
for i in `ip -br link | cut -d" " -f1`
do
if [ ${i} != "bkp0" ]
then
ping -c 1 -I ${i} so.me.add.ress
fi
done
Do you just need one to work to call it "good"? If you need to check the connectivity for all of the interfaces except one, and you know the name of the interface, you could script it:
for i in `ip -br link | cut -d" " -f1`
do
if [ ${i} != "bkp0" ]
then
ping -c 1 -I ${i} so.me.add.ress
fi
done
answered 2 days ago
kevlinux
1642
1642
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481597%2fexclude-interface-when-send-icmp-ping%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown