SlideShare a Scribd company logo
1 of 3
Write a Python program that reads IP addresses from an input
file (ip_input.txt), checks its format and validity, and then
checks its connectivity to each IP. Use the IP input file shown
as below. Submit your code and the output screen shots after a
run.
8.8.8.8
2.2.2.2.2
127.5.6.7
3.3.3.305
0.120.3.5
8.8.8.1
169.234.6.8
8.8.4.4
4.4.8.8
(you may add more to test your code)
Validity check (check the format and filter the addresses that
are not publicly routable):
- IP should be four dotted format (x.x.x.x)
- octets having values between 0-255.
- IP should not belong to one of these blocks:
o 0.0.0.0/8
o 127.0.0.0/8
o 169.254.0.0/8
o (you may add more if you like)
Connectivity check:
- Use ping for testing reachability to the IP address.
The output could look like:
Ip address: 8.8.8.8
Validity: yes
Reachability: yes
Ip address: 2.2.2.2.2
Validity: no – bad format
Reachability: no
Ip address: 127.5.6.7
Validity: no – in block 127.0.0.0/8
Reachability: no
…….
…….

More Related Content

Similar to Write a Python program that reads IP addresses from an input fil.docx

RTI-CODES+ISSS-2012-Submission-1
RTI-CODES+ISSS-2012-Submission-1RTI-CODES+ISSS-2012-Submission-1
RTI-CODES+ISSS-2012-Submission-1Serge Amougou
 
Networking Brush Up for Amazon AWS Administrators
Networking Brush Up for Amazon AWS AdministratorsNetworking Brush Up for Amazon AWS Administrators
Networking Brush Up for Amazon AWS AdministratorsAniekan Akpaffiong
 
Ip protocol
Ip protocolIp protocol
Ip protocolH K
 
BlackHat Hacking - Hacking VoIP.
BlackHat Hacking - Hacking VoIP.BlackHat Hacking - Hacking VoIP.
BlackHat Hacking - Hacking VoIP.Sumutiu Marius
 
IP Address
IP AddressIP Address
IP Addresstishko18
 
Network Protocol Testing Using Robot Framework
Network Protocol Testing Using Robot FrameworkNetwork Protocol Testing Using Robot Framework
Network Protocol Testing Using Robot FrameworkPayal Jain
 
Socket programming-in-python
Socket programming-in-pythonSocket programming-in-python
Socket programming-in-pythonYuvaraja Ravi
 
Internetworking With Pix Firewall
Internetworking With Pix FirewallInternetworking With Pix Firewall
Internetworking With Pix FirewallSouvik Santra
 
Internet protocols
Internet protocolsInternet protocols
Internet protocolsRohit Saini
 
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginFast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginTakahiro Haruyama
 
Istio's mixer policy enforcement with custom adapters (cloud nativecon 17)
Istio's mixer  policy enforcement with custom adapters (cloud nativecon 17)Istio's mixer  policy enforcement with custom adapters (cloud nativecon 17)
Istio's mixer policy enforcement with custom adapters (cloud nativecon 17)Torin Sandall
 

Similar to Write a Python program that reads IP addresses from an input fil.docx (20)

RTI-CODES+ISSS-2012-Submission-1
RTI-CODES+ISSS-2012-Submission-1RTI-CODES+ISSS-2012-Submission-1
RTI-CODES+ISSS-2012-Submission-1
 
Networking Brush Up for Amazon AWS Administrators
Networking Brush Up for Amazon AWS AdministratorsNetworking Brush Up for Amazon AWS Administrators
Networking Brush Up for Amazon AWS Administrators
 
Html 5 web forms 2
Html 5 web forms 2Html 5 web forms 2
Html 5 web forms 2
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
Chapter 9
Chapter 9Chapter 9
Chapter 9
 
PYTHON PROGRAMMING NOTES RKREDDY.pdf
PYTHON PROGRAMMING NOTES RKREDDY.pdfPYTHON PROGRAMMING NOTES RKREDDY.pdf
PYTHON PROGRAMMING NOTES RKREDDY.pdf
 
Dhcp options supported
Dhcp options supportedDhcp options supported
Dhcp options supported
 
Ip protocol
Ip protocolIp protocol
Ip protocol
 
BlackHat Hacking - Hacking VoIP.
BlackHat Hacking - Hacking VoIP.BlackHat Hacking - Hacking VoIP.
BlackHat Hacking - Hacking VoIP.
 
IP Address
IP AddressIP Address
IP Address
 
IPV6
IPV6IPV6
IPV6
 
Network Protocol Testing Using Robot Framework
Network Protocol Testing Using Robot FrameworkNetwork Protocol Testing Using Robot Framework
Network Protocol Testing Using Robot Framework
 
TCP/IP Basics
TCP/IP BasicsTCP/IP Basics
TCP/IP Basics
 
Socket programming-in-python
Socket programming-in-pythonSocket programming-in-python
Socket programming-in-python
 
Web technology unit I - Part B
Web technology unit I - Part BWeb technology unit I - Part B
Web technology unit I - Part B
 
Internetworking With Pix Firewall
Internetworking With Pix FirewallInternetworking With Pix Firewall
Internetworking With Pix Firewall
 
Internet protocols
Internet protocolsInternet protocols
Internet protocols
 
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility PluginFast and Generic Malware Triage Using openioc_scan Volatility Plugin
Fast and Generic Malware Triage Using openioc_scan Volatility Plugin
 
Istio's mixer policy enforcement with custom adapters (cloud nativecon 17)
Istio's mixer  policy enforcement with custom adapters (cloud nativecon 17)Istio's mixer  policy enforcement with custom adapters (cloud nativecon 17)
Istio's mixer policy enforcement with custom adapters (cloud nativecon 17)
 
Ip address
Ip addressIp address
Ip address
 

More from alexandernmeredith30

Write a Python program to convert temperature from Celsius to Fahren.docx
Write a Python program to convert temperature from Celsius to Fahren.docxWrite a Python program to convert temperature from Celsius to Fahren.docx
Write a Python program to convert temperature from Celsius to Fahren.docxalexandernmeredith30
 
Write a reading reflection notes of chapter one up to chapter 6 in.docx
Write a reading reflection notes of chapter one up to chapter 6 in.docxWrite a reading reflection notes of chapter one up to chapter 6 in.docx
Write a reading reflection notes of chapter one up to chapter 6 in.docxalexandernmeredith30
 
Write a Reaction Paper- Assigned 4-5pages.What are the human.docx
Write a Reaction Paper- Assigned 4-5pages.What are the human.docxWrite a Reaction Paper- Assigned 4-5pages.What are the human.docx
Write a Reaction Paper- Assigned 4-5pages.What are the human.docxalexandernmeredith30
 
Write a qualitative research paper with the following topic The He.docx
Write a qualitative research paper with the following topic The He.docxWrite a qualitative research paper with the following topic The He.docx
Write a qualitative research paper with the following topic The He.docxalexandernmeredith30
 
Write a Python program to hold information on a courseProg.docx
Write a Python program to hold information on a courseProg.docxWrite a Python program to hold information on a courseProg.docx
Write a Python program to hold information on a courseProg.docxalexandernmeredith30
 
Write a proposal to a local government official to propose a cha.docx
Write a proposal to a local government official to propose a cha.docxWrite a proposal to a local government official to propose a cha.docx
Write a proposal to a local government official to propose a cha.docxalexandernmeredith30
 
Write a proposal of 200 words. In this proposal, explain your future.docx
Write a proposal of 200 words. In this proposal, explain your future.docxWrite a proposal of 200 words. In this proposal, explain your future.docx
Write a proposal of 200 words. In this proposal, explain your future.docxalexandernmeredith30
 
Write a proposal about indian songs Zindagi Bhar Nahin Bhulegi” In.docx
Write a proposal about indian songs Zindagi Bhar Nahin Bhulegi” In.docxWrite a proposal about indian songs Zindagi Bhar Nahin Bhulegi” In.docx
Write a proposal about indian songs Zindagi Bhar Nahin Bhulegi” In.docxalexandernmeredith30
 
Write a proposal according to the promptinstructions on the attac.docx
Write a proposal according to the promptinstructions on the attac.docxWrite a proposal according to the promptinstructions on the attac.docx
Write a proposal according to the promptinstructions on the attac.docxalexandernmeredith30
 
Write a Project Risk Management Paper. Your Essay should cover the f.docx
Write a Project Risk Management Paper. Your Essay should cover the f.docxWrite a Project Risk Management Paper. Your Essay should cover the f.docx
Write a Project Risk Management Paper. Your Essay should cover the f.docxalexandernmeredith30
 
Write a program with a class called Employee for 5 employees with a .docx
Write a program with a class called Employee for 5 employees with a .docxWrite a program with a class called Employee for 5 employees with a .docx
Write a program with a class called Employee for 5 employees with a .docxalexandernmeredith30
 
Write a program that uses the ArrayList class and populate it with a.docx
Write a program that uses the ArrayList class and populate it with a.docxWrite a program that uses the ArrayList class and populate it with a.docx
Write a program that uses the ArrayList class and populate it with a.docxalexandernmeredith30
 
Write a program that gets two inputs an integer and a character. Use.docx
Write a program that gets two inputs an integer and a character. Use.docxWrite a program that gets two inputs an integer and a character. Use.docx
Write a program that gets two inputs an integer and a character. Use.docxalexandernmeredith30
 
Write a press release with media list.Introduction paragraph sta.docx
Write a press release with media list.Introduction paragraph sta.docxWrite a press release with media list.Introduction paragraph sta.docx
Write a press release with media list.Introduction paragraph sta.docxalexandernmeredith30
 
Write a Process  Paragraph  Write at least  six steps.  .docx
Write a Process  Paragraph  Write at least  six steps.  .docxWrite a Process  Paragraph  Write at least  six steps.  .docx
Write a Process  Paragraph  Write at least  six steps.  .docxalexandernmeredith30
 
write a post that agrees OR disagrees with the assertion. Cite.docx
write a post that agrees OR disagrees with the assertion. Cite.docxwrite a post that agrees OR disagrees with the assertion. Cite.docx
write a post that agrees OR disagrees with the assertion. Cite.docxalexandernmeredith30
 
Write a Process  Paragraph  Write at least  six steps.  Reme.docx
Write a Process  Paragraph  Write at least  six steps.  Reme.docxWrite a Process  Paragraph  Write at least  six steps.  Reme.docx
Write a Process  Paragraph  Write at least  six steps.  Reme.docxalexandernmeredith30
 
Write a post in response to the following prompt.Pick an institu.docx
Write a post in response to the following prompt.Pick an institu.docxWrite a post in response to the following prompt.Pick an institu.docx
Write a post in response to the following prompt.Pick an institu.docxalexandernmeredith30
 
write a position paper of at least 350 words. You must use proper ci.docx
write a position paper of at least 350 words. You must use proper ci.docxwrite a position paper of at least 350 words. You must use proper ci.docx
write a position paper of at least 350 words. You must use proper ci.docxalexandernmeredith30
 
Write a policy report on one of the highly debated areas in Public E.docx
Write a policy report on one of the highly debated areas in Public E.docxWrite a policy report on one of the highly debated areas in Public E.docx
Write a policy report on one of the highly debated areas in Public E.docxalexandernmeredith30
 

More from alexandernmeredith30 (20)

Write a Python program to convert temperature from Celsius to Fahren.docx
Write a Python program to convert temperature from Celsius to Fahren.docxWrite a Python program to convert temperature from Celsius to Fahren.docx
Write a Python program to convert temperature from Celsius to Fahren.docx
 
Write a reading reflection notes of chapter one up to chapter 6 in.docx
Write a reading reflection notes of chapter one up to chapter 6 in.docxWrite a reading reflection notes of chapter one up to chapter 6 in.docx
Write a reading reflection notes of chapter one up to chapter 6 in.docx
 
Write a Reaction Paper- Assigned 4-5pages.What are the human.docx
Write a Reaction Paper- Assigned 4-5pages.What are the human.docxWrite a Reaction Paper- Assigned 4-5pages.What are the human.docx
Write a Reaction Paper- Assigned 4-5pages.What are the human.docx
 
Write a qualitative research paper with the following topic The He.docx
Write a qualitative research paper with the following topic The He.docxWrite a qualitative research paper with the following topic The He.docx
Write a qualitative research paper with the following topic The He.docx
 
Write a Python program to hold information on a courseProg.docx
Write a Python program to hold information on a courseProg.docxWrite a Python program to hold information on a courseProg.docx
Write a Python program to hold information on a courseProg.docx
 
Write a proposal to a local government official to propose a cha.docx
Write a proposal to a local government official to propose a cha.docxWrite a proposal to a local government official to propose a cha.docx
Write a proposal to a local government official to propose a cha.docx
 
Write a proposal of 200 words. In this proposal, explain your future.docx
Write a proposal of 200 words. In this proposal, explain your future.docxWrite a proposal of 200 words. In this proposal, explain your future.docx
Write a proposal of 200 words. In this proposal, explain your future.docx
 
Write a proposal about indian songs Zindagi Bhar Nahin Bhulegi” In.docx
Write a proposal about indian songs Zindagi Bhar Nahin Bhulegi” In.docxWrite a proposal about indian songs Zindagi Bhar Nahin Bhulegi” In.docx
Write a proposal about indian songs Zindagi Bhar Nahin Bhulegi” In.docx
 
Write a proposal according to the promptinstructions on the attac.docx
Write a proposal according to the promptinstructions on the attac.docxWrite a proposal according to the promptinstructions on the attac.docx
Write a proposal according to the promptinstructions on the attac.docx
 
Write a Project Risk Management Paper. Your Essay should cover the f.docx
Write a Project Risk Management Paper. Your Essay should cover the f.docxWrite a Project Risk Management Paper. Your Essay should cover the f.docx
Write a Project Risk Management Paper. Your Essay should cover the f.docx
 
Write a program with a class called Employee for 5 employees with a .docx
Write a program with a class called Employee for 5 employees with a .docxWrite a program with a class called Employee for 5 employees with a .docx
Write a program with a class called Employee for 5 employees with a .docx
 
Write a program that uses the ArrayList class and populate it with a.docx
Write a program that uses the ArrayList class and populate it with a.docxWrite a program that uses the ArrayList class and populate it with a.docx
Write a program that uses the ArrayList class and populate it with a.docx
 
Write a program that gets two inputs an integer and a character. Use.docx
Write a program that gets two inputs an integer and a character. Use.docxWrite a program that gets two inputs an integer and a character. Use.docx
Write a program that gets two inputs an integer and a character. Use.docx
 
Write a press release with media list.Introduction paragraph sta.docx
Write a press release with media list.Introduction paragraph sta.docxWrite a press release with media list.Introduction paragraph sta.docx
Write a press release with media list.Introduction paragraph sta.docx
 
Write a Process  Paragraph  Write at least  six steps.  .docx
Write a Process  Paragraph  Write at least  six steps.  .docxWrite a Process  Paragraph  Write at least  six steps.  .docx
Write a Process  Paragraph  Write at least  six steps.  .docx
 
write a post that agrees OR disagrees with the assertion. Cite.docx
write a post that agrees OR disagrees with the assertion. Cite.docxwrite a post that agrees OR disagrees with the assertion. Cite.docx
write a post that agrees OR disagrees with the assertion. Cite.docx
 
Write a Process  Paragraph  Write at least  six steps.  Reme.docx
Write a Process  Paragraph  Write at least  six steps.  Reme.docxWrite a Process  Paragraph  Write at least  six steps.  Reme.docx
Write a Process  Paragraph  Write at least  six steps.  Reme.docx
 
Write a post in response to the following prompt.Pick an institu.docx
Write a post in response to the following prompt.Pick an institu.docxWrite a post in response to the following prompt.Pick an institu.docx
Write a post in response to the following prompt.Pick an institu.docx
 
write a position paper of at least 350 words. You must use proper ci.docx
write a position paper of at least 350 words. You must use proper ci.docxwrite a position paper of at least 350 words. You must use proper ci.docx
write a position paper of at least 350 words. You must use proper ci.docx
 
Write a policy report on one of the highly debated areas in Public E.docx
Write a policy report on one of the highly debated areas in Public E.docxWrite a policy report on one of the highly debated areas in Public E.docx
Write a policy report on one of the highly debated areas in Public E.docx
 

Recently uploaded

ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 

Recently uploaded (20)

ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 

Write a Python program that reads IP addresses from an input fil.docx

  • 1. Write a Python program that reads IP addresses from an input file (ip_input.txt), checks its format and validity, and then checks its connectivity to each IP. Use the IP input file shown as below. Submit your code and the output screen shots after a run. 8.8.8.8 2.2.2.2.2 127.5.6.7 3.3.3.305 0.120.3.5 8.8.8.1 169.234.6.8 8.8.4.4 4.4.8.8 (you may add more to test your code) Validity check (check the format and filter the addresses that are not publicly routable): - IP should be four dotted format (x.x.x.x) - octets having values between 0-255.
  • 2. - IP should not belong to one of these blocks: o 0.0.0.0/8 o 127.0.0.0/8 o 169.254.0.0/8 o (you may add more if you like) Connectivity check: - Use ping for testing reachability to the IP address. The output could look like: Ip address: 8.8.8.8 Validity: yes Reachability: yes Ip address: 2.2.2.2.2 Validity: no – bad format Reachability: no Ip address: 127.5.6.7 Validity: no – in block 127.0.0.0/8 Reachability: no …….