Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Shell 

[SOURCE] Subnet Calculator V2.0 [SOURCE]

I made a post about this before, but the code as really sloppy cuz i was soooo tired when I wrote it, but I re-vamped it tho, this code should be easier on our eyes 🤩

So today in my ccna class i had nothing to do really (waiting on the instructor to be ready to administer my performance exam). So I as just playing around and made a comment to my friend about a batch based Subnet Calculator. He said he didn't think I could make it. Soo being bored I took other challenge.

Now its not completely finished, but here's its functionality thus far:

-First it has you enter in the octets of your example IP.
-Next you enter in the octets of the IP's subnet mask (with the interesting octet)
-Then it does all the calculations and it spits out:
  • IP Class

  • Subnet Interesting Octet

  • Hosts Per Subnet

  • Maximum Number of Subnets



-Then also for the subnet in the range specific to the IP you entered:
  • Subnet ID

  • Brodcast ID

  • First Useable IP

  • Last Useable IP



-Then also for the first subnet in the range:
  • Subnet ID

  • Brodcast ID

  • First Useable IP

  • Last Useable IP



Here's the source:
SubnetCalc.bat
http://pastebin.com/2CTGRPv6

What do you think of it? 👍

NOTE: put this up again cuz I accidentally closed the other thread.
Nice, i don't know what this program is useful for though? 🤨
In the land of the blind, the one-eyed man is king

Blood makes you related, but loyalty makes you family

(Nov 1, 2012 09:34 AM)SIM-1073426 Wrote:  Nice, i don't know what this program is useful for though? 🤨

Its for subnetting. A subnetwork, or subnet, is a logically visible subdivision of an IP network. The practice of dividing a network into two or more networks is called subnetting. The benefits of subnetting vary with each deployment scenario. In the address allocation architecture of the Internet using Classless Inter-Domain Routing (CIDR) and in large organizations, it is necessary to allocate address space efficiently. It may also enhance routing efficiency, or have advantages in network management when subnetworks are administratively controlled by different entities in a larger organization. Subnets may be arranged logically in a hierarchical architecture, partitioning an organization's network address space into a tree-like routing structure.
"(Today 04:14 AM)Greenp0ison Wrote:
Or you could do this:
Code:
setlocal enabledelayedexpansion
set /p ip=Your IP:
set ip=%ip:.= %
for %%g in (%ip%) do (
set /a a+=1
set ip_digit_!a!=%%~g
)

I'm making this on XP tho and XP wouldn't support that, anyways, I'm closing this thread please look to the other thread for the cleaned up code."

That code doesn't seem to have any dependencies that XP can't fulfill.
(Nov 1, 2012 12:13 PM)White Light Wrote:  "(Today 04:14 AM)Greenp0ison Wrote:
Or you could do this:
Code:
setlocal enabledelayedexpansion
set /p ip=Your IP:
set ip=%ip:.= %
for %%g in (%ip%) do (
set /a a+=1
set ip_digit_!a!=%%~g
)

I'm making this on XP tho and XP wouldn't support that, anyways, I'm closing this thread please look to the other thread for the cleaned up code."

That code doesn't seem to have any dependencies that XP can't fulfill.

Its the brackets ( ) , XP doesn't seep to like them to much :/
(Nov 1, 2012 04:19 PM)Ego Inc Wrote:  Its the brackets ( ) , XP doesn't seep to like them to much :/

Before I upgrade to Windows 7, I used XP. There are no nesting issues on XP, that is unless you're doing it wrong.
(Nov 1, 2012 05:41 PM)White Light Wrote:  Before I upgrade to Windows 7, I used XP. There are no nesting issues on XP, that is unless you're doing it wrong.

Oh i got it to work i a vm :/ guess that computers just weird lol, but in a vm of xp it works our right :P

thanks haha you just shortened m code by a shit ton
Very good :> I thought about tackling this problem for a project I made, but decided to spend my efforts elsewhere instead since my company network only really uses one subnet mask.
(Feb 24, 2015 06:57 PM)annikk.exe Wrote:  Very good :> I thought about tackling this problem for a project I made, but decided to spend my efforts elsewhere instead since my company network only really uses one subnet mask.

Lmao you're the first person to actually understand what this is for cx
I use cisco's subnet calculator at work, but this is a good challenge for batch
There's no place like ~/
(Feb 24, 2015 06:22 PM)Ego Inc Wrote:  Oh i got it to work i a vm :/ guess that computers just weird lol, but in a vm of xp it works our right :P

thanks haha you just shortened m code by a shit ton

Wow, this is a blast from the past. Not too often I see something HQ ed up from more than 2 years ago.
This is sexy AF
Gonna use this quite a bit, used to use the Cisco one
(Feb 25, 2015 01:53 AM)White Light Wrote:  Wow, this is a blast from the past. Not too often I see something HQ ed up from more than 2 years ago.

I know right? I was just like oh, hello guess someone go bored and went grave digging cx
(Feb 25, 2015 07:22 AM)Ego Inc Wrote:  I know right? I was just like oh, hello guess someone go bored and went grave digging cx

Purrhaps I'm missing something, but wasn't it your post that was the cause of the búmp?
(Feb 25, 2015 07:39 AM)annikk.exe Wrote:  Purrhaps I'm missing something, but wasn't it your post that was the cause of the búmp?
It sowed at the top for me when I replied tho? idek


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by BestService.Mar 15, 2018 11:16 PM 3 255 Mar 15, 2018 11:16 PM
Last Post: 0xDEAD10CC
[.NET] by Leroy Jethro GibbsMar 10, 2018 06:28 PM 10 296 Mar 10, 2018 06:28 PM
Last Post: Ninja
[Shell] by TravelersAug 1, 2017 09:42 AM 3 231 Aug 1, 2017 09:42 AM
Last Post: Johnny Cache