networking | Brain Goo https://www.popmartian.com/tipsntricks Carpe Crap 'em Wed, 21 Oct 2026 14:52:32 +0000 en-US hourly 1 https://wordpress.org/?v=6.9.10 Linux HOWTO Enable Miltucast Ping (ICMP) Replies (Echo) https://www.popmartian.com/tipsntricks/2011/04/21/linux-howto-enable-miltucast-ping-icmp-replies-echo/ Thu, 21 Apr 2011 17:50:07 +0000 http://www.popmartian.com/tipsntricks/?p=206 The 2.6 Linux kernel does not respond to multicast ICMP Echo requests by default. This is a setting in /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts Test it: # cat /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts 1 # Set it to 0 for ping replies: # echo "0" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts # … Continue reading →

The post Linux HOWTO Enable Miltucast Ping (ICMP) Replies (Echo) first appeared on Brain Goo.

]]>
The 2.6 Linux kernel does not respond to multicast ICMP Echo requests by default. This is a setting in /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts

Test it:

# cat /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
1
#

Set it to 0 for ping replies:

# echo "0" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
# cat /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
0
#

The post Linux HOWTO Enable Miltucast Ping (ICMP) Replies (Echo) first appeared on Brain Goo.

]]>
Perl code to find an IP A in subnet B/C https://www.popmartian.com/tipsntricks/2007/06/05/perl-code-to-find-an-ip-a-in-subnet-bc/ https://www.popmartian.com/tipsntricks/2007/06/05/perl-code-to-find-an-ip-a-in-subnet-bc/#respond Tue, 05 Jun 2007 22:14:39 +0000 http://www.popmartian.com/tipsntricks/2007/06/05/perl-code-to-find-an-ip-a-in-subnet-bc/ my $ip = '1.2.3.4'; my $block1 = '1.2.3.0/27'; if(checkip($ip, $block1)) { print STDOUT "$ip is in $block1\n"; } else { print STDOUT "$ip is not in $block1\n"; } sub checkip() { my $ip = shift; my $block = shift; @ip1 … Continue reading →

The post Perl code to find an IP A in subnet B/C first appeared on Brain Goo.

]]>
my $ip = '1.2.3.4'; my $block1 = '1.2.3.0/27'; if(checkip($ip, $block1)) { print STDOUT "$ip is in $block1\n"; } else { print STDOUT "$ip is not in $block1\n"; } sub checkip() { my $ip = shift; my $block = shift; @ip1 = split(/\./, $ip); $ip1 = $ip1[0] * 2**24 + $ip1[1] * 2**16 + $ip1[2] * 2**8 + $ip1[3]; my @temp = split(/\//, $block); $ip2 = $temp[0]; my $netmask = $temp[1]; @ip2 = split(/\./, $ip2); $ip2 = $ip2[0] * 2**24 + $ip2[1] * 2**16 + $ip2[2] * 2**8 + $ip2[3]; if( $ip1 >> (32-$netmask) == $ip2 >> (32-$netmask) ) { return 1; } return 0; }

The post Perl code to find an IP A in subnet B/C first appeared on Brain Goo.

]]>
https://www.popmartian.com/tipsntricks/2007/06/05/perl-code-to-find-an-ip-a-in-subnet-bc/feed/ 0