Your solution returns the numberic() of the current address field, which is the base network address.
Not so. Did you type in $net_addr where you should have typed $net_broadcast?
use NetAddr::IP (); my $net_addr = NetAddr::IP->new('192.168.1.0/29'); my $net_broadcast = $net_addr->broadcast(); my $net_newaddr; { my ($addr, $mask) = $net_broadcast->numeric(); $net_newaddr = NetAddr::IP->new($addr+1, $mask); } print("$net_addr\n"); # prints 192.168.1.0/29 print("$net_broadcast\n"); # prints 192.168.1.7/29 print("$net_newaddr\n"); # prints 192.168.1.8/29
In reply to Re^3: NetAddr::IP Automated Subnet Allocation
by ikegami
in thread NetAddr::IP Automated Subnet Allocation
by amt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |