Question: Practicing with Perl Scripts. 1. Write a scriptipmac_hash.pl to: * Read in the file dhcpd.conf ( You will find the contents of this file in

Practicing with Perl Scripts.

1. Write a scriptipmac_hash.pl to:

* Read in the file dhcpd.conf ( You will find the contents of this file in the end).

* Extract the IP address and the MAC address pairs from the file.

* Create a hash named %ipMac that contains these pairs with the IP as the key.

* Print out this hash in raw format. This can be printed to standard output.

2. Hash Printing (ipmac_hash_fmt.pl):

* Print out the hash in a formatted printed page format. See perldocs for how to do this.

Contents of the dhcpd.conf

# service isc-dhcp-server restart to restart DHCPD and to see changes # # If this DHCP server is the official DHCP server for the local # network, the authoritative directive should be uncommented. authoritative; option domain-name "it.cs.umb.edu";

# This is a very basic subnet declaration.

# Make sure we never serve anything outside the IT LAN, # even though we expect to never see them. shared-network UMB-CAMPUS { deny unknown-clients; subnet 158.121.0.0 netmask 255.255.0.0 { } } shared-network CS-LAN { deny unknown-clients; subnet 192.168.0.0 netmask 255.255.0.0 { } }

subnet 10.0.0.0 netmask 255.255.255.0 { # There are no pool addresses in this configuration # If you want to enable pool addresses uncomment the range lines # and the allow line and comment out the deny line # deny unknown-clients; allow unknown-clients; range 10.0.0.20 10.0.0.89; #option domain-name-servers 192.168.106.248,192.168.106.247; # 2016-09 name servers windc05 and windc06 on the IT LAN. option domain-name-servers 10.0.0.251,10.0.0.252; option domain-name-servers 10.0.0.1,192.168.104.12; option routers 10.0.0.1; default-lease-time 600; max-lease-time 7200; }

# These are the host PCs it21 - it28. # When plugged inside they get hostnames and separate IPs # in the it subdomain.

host it21.it.cs.umb.edu { hardware ethernet 34:17:eb:bd:5c:78; fixed-address 10.0.0.240; }

host it22.it.cs.umb.edu { hardware ethernet 34:17:eb:bd:d2:b6; fixed-address 10.0.0.241; }

host it23.it.cs.umb.edu { hardware ethernet 34:17:eb:bd:57:a2; fixed-address 10.0.0.242; }

host it24.it.cs.umb.edu { hardware ethernet 34:17:eb:bd:50:0d; fixed-address 10.0.0.243; }

host it25.it.cs.umb.edu { hardware ethernet 34:17:eb:bd:5e:26; fixed-address 10.0.0.244; }

host it26.it.cs.umb.edu { hardware ethernet 34:17:eb:bd:5e:a9; fixed-address 10.0.0.245; }

host it27.it.cs.umb.edu { hardware ethernet 34:17:eb:bd:5d:a0; fixed-address 10.0.0.246; }

host it28.it.cs.umb.edu { hardware ethernet 98:90:96:b0:f8:2c; fixed-address 10.0.0.247; }

# it30 is an extra PC, halfway down on the right side. # it30 is an older PC with no model number displayed. # It is intended for use by the instructors host it30.it.cs.umb.edu { hardware ethernet 00:21:9b:7b:c2:1d; fixed-address 10.0.0.248; }

# IT31 ia sn extra PC, halfway down on the left side. # IT31 is the same model as the other new it2x PCs. # IT31 has a Windows operating system and for use with the Samba Lab host it31.it.cs.umb.edu { hardware ethernet 34:17:eb:bd:c7:9e; fixed-address 10.0.0.249; }

# This is the printer in the IT lab

#host itpr11.it.cs.umb.edu { # hardware ethernet a0:48:1c:6b:d3:ee; # fixed address 10.0.0.20; #}

# # These are the Virtual Machines. #

# IT341 Section 1 Group a Virtual Machines

host itvm21-1a.it.cs.umb.edu { hardware ethernet 00:0c:29:15:e3:7a; fixed-address 10.0.0.128; }

host itvm22-1a.it.cs.umb.edu { hardware ethernet 00:0c:29:e1:38:5c; fixed-address 10.0.0.129; }

host itvm23-1a.it.cs.umb.edu { hardware ethernet 00:0c:29:57:39:b4; fixed-address 10.0.0.130; }

host itvm24-1a.it.cs.umb.edu { hardware ethernet 00:0c:29:af:78:31; fixed-address 10.0.0.131; }

host itvm25-1a.it.cs.umb.edu { hardware ethernet 00:0C:29:f3:46:f9; fixed-address 10.0.0.132; }

host itvm26-1a.it.cs.umb.edu { hardware ethernet 00:0c:29:22:12:d2; fixed-address 10.0.0.133; }

host itvm27-1a.it.cs.umb.edu { hardware ethernet 00:0c:29:a3:9a:7b; fixed-address 10.0.0.134; }

host itvm28-1a.it.cs.umb.edu { hardware ethernet 00:0c:29:0f:2a:41; fixed-address 10.0.0.135; }

# IT341 Section 1 Group b Virtual Machines

# host itvm21-1b.it.cs.umb.edu { hardware ethernet 00:0C:29:8c:68:7e; fixed-address 10.0.0.136; }

host itvm22-1b.it.cs.umb.edu { hardware ethernet 00:0c:29:ed:d7:07; fixed-address 10.0.0.137; }

host itvm23-1b.it.cs.umb.edu { hardware ethernet 00:0c:29:8c:ec:0f; fixed-address 10.0.0.138; }

host itvm24-1b.it.cs.umb.edu { hardware ethernet 00:0c:29:e2:31:0b; fixed-address 10.0.0.139; }

host itvm25-1b.it.cs.umb.edu { hardware ethernet 00:0C:29:18:2b:f2; fixed-address 10.0.0.140; }

host itvm26-1b.it.cs.umb.edu { hardware ethernet 00:0c:29:0a:1d:93; fixed-address 10.0.0.141; }

host itvm27-1b.it.cs.umb.edu { hardware ethernet 00:0c:29:cd:eb:29; fixed-address 10.0.0.142; }

host itvm28-1b.it.cs.umb.edu { hardware ethernet 00:0c:29:4c:48:53; fixed-address 10.0.0.143; }

# IT341 Section 2 Group a Virtual Machines

host itvm21-2a.it.cs.umb.edu { hardware ethernet 00:0C:29:a2:42:3f; fixed-address 10.0.0.144; }

host itvm22-2a.it.cs.umb.edu { hardware ethernet 00:0c:29:4f:3c:ef; fixed-address 10.0.0.145; }

host itvm23-2a.it.cs.umb.edu { hardware ethernet 00:0c:29:5c:01:3f; fixed-address 10.0.0.146; }

host itvm24-2a.it.cs.umb.edu { hardware ethernet 00:0c:29:ac:8a:a0; fixed-address 10.0.0.147; }

host itvm25-2a.it.cs.umb.edu { hardware ethernet 00:0C:29:40:3c:11; fixed-address 10.0.0.148; }

host itvm26-2a.it.cs.umb.edu { hardware ethernet 00:0c:29:67:2c:43; fixed-address 10.0.0.149; }

host itvm27-2a.it.cs.umb.edu { hardware ethernet 00:0c:29:fd:bb:af; fixed-address 10.0.0.150; }

host itvm28-2a.it.cs.umb.edu { hardware ethernet 00:0c:29:0c:a0:2d; fixed-address 10.0.0.151; }

# IT341 Section 2 Group b Virtual Machines

# host itvm21-2b.it.cs.umb.edu { hardware ethernet 00:0C:29:ab:f2:c4; fixed-address 10.0.0.152; }

host itvm22-2b.it.cs.umb.edu { hardware ethernet 00:0c:29:ad:53:a3; fixed-address 10.0.0.153; }

host itvm23-2b.it.cs.umb.edu { hardware ethernet 00:0c:29:4b:70:69; fixed-address 10.0.0.154; }

host itvm24-2b.it.cs.umb.edu { hardware ethernet 00:0c:29:cc:79:27; fixed-address 10.0.0.155; }

host itvm25-2b.it.cs.umb.edu { hardware ethernet 00:0C:29:d8:00:4b; fixed-address 10.0.0.156; }

host itvm26-2b.it.cs.umb.edu { hardware ethernet 00:0c:29:00:41:25; fixed-address 10.0.0.157; }

#host itvm27-2b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.158; #}

host itvm28-2b.it.cs.umb.edu { hardware ethernet 00:0c:29:74:75:b7; fixed-address 10.0.0.159; }

# IT341 Section 3 Group a Virtual Machines

host itvm21-3a.it.cs.umb.edu { hardware ethernet 00:0C:29:48:ba:f5; fixed-address 10.0.0.160; }

host itvm22-3a.it.cs.umb.edu { hardware ethernet 00:0c:29:f8:1f:58; fixed-address 10.0.0.161; }

host itvm23-3a.it.cs.umb.edu { hardware ethernet 00:0c:29:54:ef:c4; fixed-address 10.0.0.162; }

host itvm24-3a.it.cs.umb.edu { hardware ethernet 00:0c:29:1c:6d:34; fixed-address 10.0.0.163; }

host itvm25-3a.it.cs.umb.edu { hardware ethernet 00:0C:29:0d:50:f2; fixed-address 10.0.0.164; }

host itvm26-3a.it.cs.umb.edu { hardware ethernet 00:0c:29:77:3d:f9; fixed-address 10.0.0.165; }

host itvm27-3a.it.cs.umb.edu { hardware ethernet 00:0c:29:ef:22:b4; fixed-address 10.0.0.166; }

host itvm28-3a.it.cs.umb.edu { hardware ethernet 00:0c:29:14:3d:55; fixed-address 10.0.0.167; }

# IT341 Section 3 Group b Virtual Machines

# host itvm21-3b.it.cs.umb.edu { hardware ethernet 00:0C:29:b4:10:32; fixed-address 10.0.0.168; }

host itvm22-3b.it.cs.umb.edu { hardware ethernet 00:0c:29:8d:ba:5f; fixed-address 10.0.0.169; }

host itvm23-3b.it.cs.umb.edu { hardware ethernet 00:0c:29:b3:62:97; fixed-address 10.0.0.170; }

host itvm24-3b.it.cs.umb.edu { hardware ethernet 00:0c:29:6c:df:2d; fixed-address 10.0.0.171; }

#host itvm25-3b.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.172; #}

host itvm26-3b.it.cs.umb.edu { hardware ethernet 00:0c:29:56:12:ed; fixed-address 10.0.0.173; }

host itvm27-3b.it.cs.umb.edu { hardware ethernet 00:0c:29:b2:c0:fa; fixed-address 10.0.0.174; }

host itvm28-3b.it.cs.umb.edu { hardware ethernet 00:0c:29:9b:67:34; fixed-address 10.0.0.175; }

# IT341 Section 4 Group a Virtual Machines

# #host itvm21-4a.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.176; #}

#host itvm22-4a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.177; #}

host itvm23-4a.it.cs.umb.edu { hardware ethernet 00:0c:29:91:2a:7e; fixed-address 10.0.0.178; }

#host itvm24-4a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.179; #}

#host itvm25-4a.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.180; #}

#host itvm26-4a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.181; #}

#host itvm27-4a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.182; #}

#host itvm28-4a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.183; #}

# IT341 Section 4 Group b Virtual Machines

# #host itvm21-4b.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.184; #}

#host itvm22-4b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.185; #}

#host itvm23-4b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.186; #}

#host itvm24-4b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.187; #}

#host itvm25-4b.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.188; #}

#host itvm26-4b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.189; #}

#host itvm27-4b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.190; #}

#host itvm28-4b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.191; #}

# IT341 Section 5 Group a Virtual Machines

# #host itvm21-5a.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.192; #}

#host itvm22-5a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.193; #}

#host itvm23-5a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.194; #}

#host itvm24-5a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.195; #}

#host itvm25-5a.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.196; #}

#host itvm26-5a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.197; #}

#host itvm27-5a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.198; #}

#host itvm28-5a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.0199; #}

# IT341 Section 5 Group b Virtual Machines

# #host itvm21-5b.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.200; #}

#host itvm22-5b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.201; #}

#host itvm23-5b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.202; #}

#host itvm24-5b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.203; #}

#host itvm25-5b.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.204; #}

#host itvm26-5b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.205; #}

#host itvm27-5b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.206; #}

#host itvm28-5b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.207; #}

# IT341 Section 6 Group a Virtual Machines

# #host itvm21-6a.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.208; #}

#host itvm22-6a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.209; #}

#host itvm23-6a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.210; #}

#host itvm24-6a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.211; #}

#host itvm25-6a.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.212; #}

#host itvm26-6a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.213; #}

#host itvm27-6a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.214; #}

#host itvm28-6a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.215; #}

# IT341 Section 6 Group b Virtual Machines # #host itvm21-6b.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.216; #}

#host itvm22-6b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.217; #}

#host itvm23-6b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.218; #}

#host itvm24-6b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.219; #}

#host itvm25-6b.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.220; #}

#host itvm26-6b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.221; #}

#host itvm27-6b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.222; #}

#host itvm28-6b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.223; #}

# IT341 Section 7 Group a Virtual Machines

# #host itvm21-7a.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.224; #}

#host itvm22-7a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.225; #}

#host itvm23-7a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.226; #}

#host itvm24-7a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.227; #}

#host itvm25-7a.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.228; #}

#host itvm26-7a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.229; #}

#host itvm27-7a.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.230; #}

host itvm28-7a.it.cs.umb.edu { hardware ethernet 00:0c:29:3e:40:f5; fixed-address 10.0.0.231; }

# IT341 Section 7 Group b Virtual Machines

# #host itvm21-7b.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.232; #}

#host itvm22-7b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.233; #}

#host itvm23-7b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.234; #}

#host itvm24-7b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.235; #}

#host itvm25-7b.it.cs.umb.edu { # hardware ethernet 00:0C:29:00:00:00; # fixed-address 10.0.0.236; #}

#host itvm26-7b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.237; #}

# host itvm27-7b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.238; #}

#host itvm28-7b.it.cs.umb.edu { # hardware ethernet 00:0c:29:00:00:00; # fixed-address 10.0.0.239; #}

# IPs in use by C. Kelly

host eos-ck.it.cs.umb.edu { hardware ethernet 80:fa:5b:35:ea:eb; fixed-address 10.0.0.90; }

host cktest.it.cs.umb.edu { hardware ethernet 00:0c:29:ce:b9:01; fixed-address 10.0.0.91; }

# # These are the Virtual Routers from the GNS3 Labs. #

# IT246 Section 1 Virtual Routers

host r21-01.it.cs.umb.edu { hardware ethernet c4:03:1d:21:01:00; fixed-address 10.0.0.101; }

host r22-01.it.cs.umb.edu { hardware ethernet c4:03:1d:22:01:00; fixed-address 10.0.0.102; }

host r23-01.it.cs.umb.edu { hardware ethernet c4:03:1d:23:01:00; fixed-address 10.0.0.103; }

host r24-01.it.cs.umb.edu { hardware ethernet c4:03:1d:24:01:00; fixed-address 10.0.0.104; }

host r25-01.it.cs.umb.edu { hardware ethernet c4:03:1d:25:01:00; fixed-address 10.0.0.105; }

host r26-01.it.cs.umb.edu { hardware ethernet c4:03:1d:26:01:00; fixed-address 10.0.0.106; }

host r27-01.it.cs.umb.edu { hardware ethernet c4:03:1d:27:01:00; fixed-address 10.0.0.107; }

host r28-01.it.cs.umb.edu { hardware ethernet c4:03:1d:28:01:00; fixed-address 10.0.0.108; }

# IT246 Section 3 Virtual Routers

host r21-03.it.cs.umb.edu { hardware ethernet c4:03:1d:21:03:00; fixed-address 10.0.0.109; }

host r22-03.it.cs.umb.edu { hardware ethernet c4:03:1d:22:03:00; fixed-address 10.0.0.110; }

host r23-03.it.cs.umb.edu { hardware ethernet c4:03:1d:23:03:00; fixed-address 10.0.0.111; }

host r24-03.it.cs.umb.edu { hardware ethernet c4:03:1d:24:03:00; fixed-address 10.0.0.112; }

host r25-03.it.cs.umb.edu { hardware ethernet c4:03:1d:25:03:00; fixed-address 10.0.0.113; }

host r26-03.it.cs.umb.edu { hardware ethernet c4:03:1d:26:03:00; fixed-address 10.0.0.114; }

host r27-03.it.cs.umb.edu { hardware ethernet c4:03:1d:27:03:00; fixed-address 10.0.0.115; }

host r28-03.it.cs.umb.edu { hardware ethernet c4:03:1d:28:03:00; fixed-address 10.0.0.116; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!