Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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: 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
Step: 1
Heres a Python script that accomplishes this task python import ipaddress def checksamesubnetip1 mas...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started