Bash script for ping in your own subnet


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Bash script for ping in your own subnet
# 15  
Old 04-14-2011
So far so good.....


ifconfig | grep 'Bcast:' | cut -d: -f3 | awk '{print $1}'


with the above I can see by broadcast IP...
but how can I tell the script in the same line to ping the output??

Output for: ifconfig | grep 'Bcast:' | cut -d: -f3 | awk '{print $1}' is 192.168.101.255 or something else. How can I also ping -b the output?



Thanks in advance
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. IP Networking

Loop in /24 Subnet, No ping beyond .1 and .2

Running 3650 switch. I have this odd issue where I cannot get 4 new Centos 7 boxes pinging out on public IPs (nor pinging in), only gateway .1 and first public IP .2 This is what I see, which doesn't look normal. How do I fix this? The server itself is configured fine (Centos 7) # cat... (0 Replies)
Discussion started by: Bashed
0 Replies

2. Shell Programming and Scripting

How to write bash script to subdivide a given subnet into a pre-defined number of smaller subnets?

Bash script to subdivide a given subnet into a pre-defined number of smaller subnets. Show network/broadcast address, number of hosts and assign gateway. For example: Input: ./subnetter.sh 192.168.0.0/24 3 Output: 192.168.0.0/128 subnet 192.168.0.0 broadcast 192.168.0.127 gateway... (1 Reply)
Discussion started by: mail2rias
1 Replies

3. Shell Programming and Scripting

How to write bash script to subdivide a given subnet into a pre-defined number of smaller subnets?

Bash script to subdivide a given subnet into a pre-defined number of smaller subnets. Show network/broadcast address, number of hosts and assign gateway. For example: Input: ./subnetter.sh 192.168.0.0/24 3 Output: 192.168.0.0/128 subnet 192.168.0.0 broadcast 192.168.0.127 gateway... (1 Reply)
Discussion started by: mail2rias
1 Replies

4. Solaris

Guest LDOMS on same subnet cant ping eachother

Hi all, New to this forum. I have just been reading through a historical thread about some issues with IPMP. Some tips from "Peasant" where very useful. Please see below "Just couple of more hints regarding VM. For VDS, use one VDS - one guest LDOM, don't put everything in primary-vds.... (9 Replies)
Discussion started by: selectstar
9 Replies

5. Shell Programming and Scripting

Need bash script to ping the servers and rename the output file each time the script is ran

HI, I have a file serverlist in that all host names are placed. i have written a small script #./testping #! /bin/bash for i in `cat serverlist` do ping $i >> output.txt done so now it creates a file output.txt till here fine.. now each time i run this script the output file... (4 Replies)
Discussion started by: madhudeva
4 Replies

6. Linux

Ping check failed from Nagios master server on windows hosts in the same subnet

Hello All, We have added a windows host and its config files to Nagios master server and wanted to do a ping check alone at the moment however, the nagios master server identifies the host in its GUI and immediately disappears can anyone let me know the right approach to this one, We want to... (2 Replies)
Discussion started by: lovesaikrishna
2 Replies

7. UNIX for Dummies Questions & Answers

Ping bash script to file

Hello: I have this script: #!/bin/bash #for loop for ip in `cat ips` do ping $ip | grep "is alive">>pingtestlog done And its working properly with this input: ericadm@amxcruas1> cat ips 10.196.60.4 10.196.61.210 10.196.62.73 10.196.61.152 (5 Replies)
Discussion started by: asenav1
5 Replies

8. IP Networking

Migrating existing Subnet to a new subnet and changing ip addresses in UNIX

Hi, My project needs to migrate the existing Subnet (255.255.255.0) to a new subnet and change the ipaddresses (currently C class). How can I do that. I need some information. John (0 Replies)
Discussion started by: johnmarsh
0 Replies

9. UNIX for Dummies Questions & Answers

Unix TCP/IP ping to other subnet

I have Digital UNIX V4.0B (Rev. 564) on alpha machine. I'm trying to acces network in subnet (192.168.1.x). Ip on Alpha comp. is from 192.168.3.X subnet. My default gateway on this network is 192.168.3.1 and it working OK from other machines. This machine is visible from same subnet... (2 Replies)
Discussion started by: ermingut
2 Replies

10. Shell Programming and Scripting

Ping script using Redhat and BAsh

Alright, I have being checking out various posting here trying to hack together something for a friend Needed: A script that can run in cron doing: ping of several hosts and notifying via email when they are unavailable. I am not going to post my non working messes (I am a basic... (11 Replies)
Discussion started by: edkung
11 Replies
Login or Register to Ask a Question
IFNDP-PROXY(5)						       Network configuration						    IFNDP-PROXY(5)

NAME
ifndp-proxy[-<interface name>] - IPv6 NDP and IPv4 ARP proxy entries SYNOPSIS
/etc/sysconfig/network/ifndp-proxy /etc/sysconfig/network/ifndp-proxy-<interface name> DESCRIPTION
These files contain IPv6 NDP and IPv4 ARP proxy settings, that should be applied using the ip neigh add proxy command documented in the ip(8) manual page that provides a common interface for IPv4 and IPv6. The NDP/ARP proxy is required, e.g. when IP addresses from the same subnet have to be used on the interface of the host as well as on interfaces behind a (tunnel) interface and using a bridge is not an option. Don't forget to enable forwarding and the NDP/ARP proxy by setting net.ipv6.conf.<all|default|interface name>.proxy_ndp = 1 net.ipv6.conf.<all|default|interface name>.forwarding = 1 and/or net.ipv4.conf.<all|default|interface name>.proxy_arp = 1 net.ipv4.conf.<all|default|interface name>.forwarding = 1 or net.ipv4.ip_forward = 1 either as global all setting in the /etc/sysctl.conf file or using the ifsysctl(5) files, that allow per-interface setup. Forwarding can be also enabled in the /etc/sysconfig/sysctl file using the IP_FORWARD and IPV6_FORWARD variables. The proxy entries are added and deleted using the if-{up|down}.d/ndp-proxy script, every time after an involved interface has been set up or down. SYNTAX
The format of the ifndp-proxy file is: <address> <address interface> <proxy interface list> The format of the ifndp-proxy-<address interface> file is same to above, but allows also to omit the address interface by using a "-" as placeholder inside of the file, because it is already available in the file name: <address> <address interface | -> <proxy interface list> Lines beginning with # and blank lines are ignored. Each line defines to add a proxy NDP/ARP entry with the address of or behind address interface to all interfaces in the proxy interface list. EXAMPLES
Let's assume, your machine is connected via eth0 to a switch with the networks 2001:db8:abba::/64 and 192.168.100.1/24 and is using the IP address 1 itself. You'd like to use the addresses 11 and 12 e.g. for virtual machines behind the tap1 and tap2 interface, that is: 2001:db8:abba::1/64 -- local eth0 address 2001:db8:abba::11/64 -- address behind tap1 2001:db8:abba::12/64 -- address behind tap2 192.168.100.1/24 -- local eth0 address 192.168.100.11/24 -- address behind tap1 192.168.100.12/24 -- address behind tap2 then set up the following entries in the ifndp-proxy file: 2001:db8:abba::1 eth0 tap1 tap2 2001:db8:abba::11 tap1 eth0 tap2 2001:db8:abba::12 tap2 eth0 tap1 192.168.100.1 eth0 tap1 tap2 192.168.100.11 tap1 eth0 tap2 192.168.100.12 tap2 eth0 tap1 additionally to the routing entries in the routes or ifroute-<interface name> files. BUGS
Please report bugs at <https://bugzilla.novell.com/> AUTHOR
Marius Tomaschewski <mt@suse.de> SEE ALSO
ifup(8) ifcfg(5) ifsysctl(8) sysconfig December 2009 IFNDP-PROXY(5)