25U subnetting app
This commit is contained in:
		
							
								
								
									
										46
									
								
								roles/WebServer/files/apps/25u_subnetting.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								roles/WebServer/files/apps/25u_subnetting.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,46 @@
 | 
			
		||||
<?php
 | 
			
		||||
 | 
			
		||||
echo '<html>
 | 
			
		||||
<head>
 | 
			
		||||
<title>25U Subnetting Practice</title>
 | 
			
		||||
</head>
 | 
			
		||||
<body>';
 | 
			
		||||
 | 
			
		||||
// Binary conversions
 | 
			
		||||
echo '<h3>Convert the following to binary:</h3>';
 | 
			
		||||
for ($x = 0; $x <= 3; $x++) {
 | 
			
		||||
    echo '<p>'.rand(0,256).'    ____________________</p>';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Decimal conversions
 | 
			
		||||
echo '<h3>Convert the following to decimal:</h3>';
 | 
			
		||||
for ($x = 0; $x <= 3; $x++) {
 | 
			
		||||
    echo '<p>';
 | 
			
		||||
 | 
			
		||||
    for ($y = 0; $y <= 7; $y++) {
 | 
			
		||||
        echo rand(0,1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    echo '    ____________________</p>';
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// CIDRs
 | 
			
		||||
echo '<h3>Convert the following slash notations to decimal and binary:</h3><table style="width:100%;"><tr><th style="width:30%;">Slash</th><th style="width:30%;">Decimal</th><th style="width:30%;">Binary</th></tr>';
 | 
			
		||||
for ($x = 0; $x <= 3; $x++) {
 | 
			
		||||
    echo '<tr><td style="border: 1px solid;">'.rand(16,32).'</td><td style="border: 1px solid;"> </td><td style="border: 1px solid;"> </td>';
 | 
			
		||||
}
 | 
			
		||||
echo '</table>';
 | 
			
		||||
 | 
			
		||||
//Subnets
 | 
			
		||||
echo '<h3>Identify the following for these CIDR’s:</h3>';
 | 
			
		||||
echo '<table style="width:100%;"><tr><th style="width:150px;">IP/CIDR</th><th style="width:150px;">SM</th><th style="width:150px;">NetID</th><th style="width:150px;">Host Range</th><th style="width:150px;">Broadcast</th><th style="width:150px;">Gateway</th><th style="width:150px;">Increment</th></tr>';
 | 
			
		||||
 | 
			
		||||
for ($x = 0; $x <= 6; $x++) {
 | 
			
		||||
    echo '<tr><td style="border: 1px solid;">'.rand(0,256).'.'.rand(0,256).'.'.rand(0,256).'.'.rand(0,256).'/'.rand(16,32).'</td><td style="border: 1px solid;"> </td><td style="border: 1px solid;"> </td><td style="border: 1px solid;"> </td><td style="border: 1px solid;"> </td><td style="border: 1px solid;"> </td><td style="border: 1px solid;"> </td></tr>';
 | 
			
		||||
}
 | 
			
		||||
echo '</table>';
 | 
			
		||||
 | 
			
		||||
echo '<h3>Bonus: Calculate the three subnets that follow each of the above.</h3>';
 | 
			
		||||
 | 
			
		||||
echo '</body></html>';
 | 
			
		||||
@@ -34,6 +34,15 @@ server {
 | 
			
		||||
        rewrite /martialarts/maqotw.xml /MartialArts/Wiki/raw/branch/main/rss/maqotw.xml;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    location /25u {
 | 
			
		||||
        include conf.d/fastcgi.config;
 | 
			
		||||
        root /usr/share/webapps/aninix/;
 | 
			
		||||
        location ~* 25u {
 | 
			
		||||
            try_files $uri /25u_subnetting.php;
 | 
			
		||||
            expires max;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    location /whatismyip {
 | 
			
		||||
        include conf.d/fastcgi.config;
 | 
			
		||||
        root /usr/share/webapps/aninix/;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user