Question: Write a program that takes FOUR user inputs: IPv4 of machine1: Subnet mask of machine1: IPv4 of machine2: Subnet mask of machine2: Your program

Write a program that takes FOUR user inputs: IPv4 of machine1: Subnet mask of machine1: IPv4 of machine2:

Write a program that takes FOUR user inputs: IPv4 of machine1: Subnet mask of machine1: IPv4 of machine2: Subnet mask of machine2: Your program should determine whether machine1 and machine2 are in the same subnet. If yes, your program should print "Yes these IP's are in the same subnet", and then your program prints the LAST IPv4 address in that subnet. If no, I your program should print the last IPv4 address in machine1's subnet, and then print the last IPv4 address in machine2's subnet run #1: IPv4 of machine1: 192.168.1.12 Subnet mask of machine1: 255.255.255.0 IPv4 of machine2: 192.168.1.123 Subnet mask of machine2: 255.255.255.0 output: Yes these are in the same subnet and the last IPv4 address in that subnet is 192.168.1.255 IPv4 of machine1: 192.168.1.12 Subnet mask of machine1: 255.255.255.0 IPv4 of machine2: 192.168.1.200 Subnet mask of machine2: 255.255.255.240 output: No, these are not in the same subnet the last IPv4 address in subnet 1 is 192.168.1.255 the last IPv4 address in subnet 2 is 192.168.1.207 Assume user input address ad subnet masks are valid

Step by Step Solution

3.48 Rating (145 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a Python script that accomplishes this task python import ipaddress def checksamesubnetip1 mas... View full answer

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 Programming Questions!