{"id":3352,"date":"2024-03-14T09:22:49","date_gmt":"2024-03-14T09:22:49","guid":{"rendered":"https:\/\/platinumsupport.in\/blog\/?p=3352"},"modified":"2024-09-21T04:36:18","modified_gmt":"2024-09-21T04:36:18","slug":"how-to-whitelist-ip-address-on-linux","status":"publish","type":"post","link":"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/","title":{"rendered":"How to whitelist IP address on Linux"},"content":{"rendered":"\n<p>To whitelist an IP address in iptables, you need to add a rule to allow incoming traffic from that IP address. Here&#8217;s how you can do it:<\/p>\n\n\n\n<p>First, if you don&#8217;t have an existing rule to allow the specific traffic on the desired port, you&#8217;ll need to add one. For example, if you want to allow incoming traffic on port 22 (SSH), you would add a rule like this<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT<\/code><\/pre>\n\n\n\n<p>This command allows incoming TCP traffic on port 22.<\/p>\n\n\n\n<p>Next, you&#8217;ll add a rule to allow traffic from the specific IP address. Let&#8217;s assume the IP address you want to whitelist is 192.168.1.100:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo iptables -A INPUT -s 192.168.1.100 -j ACCEPT\n<\/code><\/pre>\n\n\n\n<p>This command allows incoming traffic from the IP address 192.168.1.100.<\/p>\n\n\n\n<p>Finally, ensure that the default policy for incoming, outgoing, and forwarded traffic is set to drop (for security reasons) and save your changes so they persist across reboots:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo iptables -P INPUT DROP\nsudo iptables -P FORWARD DROP\nsudo iptables -P OUTPUT ACCEPT\nsudo iptables-save &gt; \/etc\/iptables\/rules.v4\n<\/code><\/pre>\n\n\n\n<p>These commands set the default policy for incoming and forwarded traffic to drop, meaning that traffic that doesn&#8217;t match any rules will be discarded. The default policy for outgoing traffic is set to accept, allowing all outgoing traffic. The iptables-save command saves the current iptables configuration to the specified file, so it will be loaded automatically on system startup.<\/p>\n\n\n\n<p>Please note that iptables rules only persist until the system is rebooted unless you save them as shown above. Additionally, if you&#8217;re using IPv6, you should also configure rules for IPv6 traffic using ip6tables.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>For Technical Assistance,<\/strong> Contact <a href=\"https:\/\/platinumsupport.in\/submitticket.php\">PlatinumSupport<\/a>:<br><\/p>\n\n\n\n<p><strong>WhatsApp<\/strong>: +91 9922950127<br><strong>Email<\/strong>: esupport@platinumsupport.in<\/p>\n\n\n\n<p><a href=\"https:\/\/platinumsupport.in\">PlatinumSupport <\/a>is here  to provide expert guidance and support,<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>To whitelist an IP address in iptables, you need to add a rule to allow incoming traffic from that IP address. Here&#8217;s how you can do it: First, if you don&#8217;t have an existing rule to allow the specific traffic on the desired port, you&#8217;ll need to add one. For example, if you want to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3352","post","type-post","status-publish","format-standard","hentry","category-cpanel-whm-technical-support-solutions"],"blocksy_meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.13 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to whitelist IP address on Linux - Knowledge Base<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to whitelist IP address on Linux\" \/>\n<meta property=\"og:description\" content=\"To whitelist an IP address in iptables, you need to add a rule to allow incoming traffic from that IP address. Here&#8217;s how you can do it: First, if you don&#8217;t have an existing rule to allow the specific traffic on the desired port, you&#8217;ll need to add one. For example, if you want to [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/platinumsupport.in\" \/>\n<meta property=\"article:published_time\" content=\"2024-03-14T09:22:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-21T04:36:18+00:00\" \/>\n<meta name=\"author\" content=\"Anand\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Anand\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/\"},\"author\":{\"name\":\"Anand\",\"@id\":\"https:\/\/platinumsupport.in\/blog\/#\/schema\/person\/aa475c6a968475a732f330a12ff18ede\"},\"headline\":\"How to whitelist IP address on Linux\",\"datePublished\":\"2024-03-14T09:22:49+00:00\",\"dateModified\":\"2024-09-21T04:36:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/\"},\"wordCount\":263,\"publisher\":{\"@id\":\"https:\/\/platinumsupport.in\/blog\/#organization\"},\"articleSection\":[\"cPanel\/WHM\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/\",\"url\":\"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/\",\"name\":\"How to whitelist IP address on Linux - Knowledge Base\",\"isPartOf\":{\"@id\":\"https:\/\/platinumsupport.in\/blog\/#website\"},\"datePublished\":\"2024-03-14T09:22:49+00:00\",\"dateModified\":\"2024-09-21T04:36:18+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/platinumsupport.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to whitelist IP address on Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/platinumsupport.in\/blog\/#website\",\"url\":\"https:\/\/platinumsupport.in\/blog\/\",\"name\":\"PlatinumSupport.in\",\"description\":\"Discover Success through Expert Guidance: Dive into the PlatinumSupport Blog for Solutions and Empowerment!\",\"publisher\":{\"@id\":\"https:\/\/platinumsupport.in\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/platinumsupport.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/platinumsupport.in\/blog\/#organization\",\"name\":\"Tech Savy Systems\",\"url\":\"https:\/\/platinumsupport.in\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/platinumsupport.in\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/platinumsupport.in\/blog\/wp-content\/uploads\/2024\/02\/psm-blog.png\",\"contentUrl\":\"https:\/\/platinumsupport.in\/blog\/wp-content\/uploads\/2024\/02\/psm-blog.png\",\"width\":250,\"height\":75,\"caption\":\"Tech Savy Systems\"},\"image\":{\"@id\":\"https:\/\/platinumsupport.in\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/platinumsupport.in\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/platinumsupport.in\/blog\/#\/schema\/person\/aa475c6a968475a732f330a12ff18ede\",\"name\":\"Anand\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/platinumsupport.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/610c86cd51134253c03e1441f07cd9c4e75bdbf5a06560ddc04e568bd85a89e5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/610c86cd51134253c03e1441f07cd9c4e75bdbf5a06560ddc04e568bd85a89e5?s=96&d=mm&r=g\",\"caption\":\"Anand\"},\"description\":\"I have been working in the web hosting support industry for over 15 years as a level 3 administrator, and I am proud to hold RED HAT certification. My expertise lies in providing support for Dedicated Servers, Cloud Servers, and VPS running various Linux operating systems such as CentOS, AlmaLinux, CloudLinux, and Ubuntu. Additionally, I am proficient in working with popular control panels like CPanel, Plesk, CWP, AApanel etc.\",\"sameAs\":[\"https:\/\/platinumsupport.in\/blog\"],\"honorificPrefix\":\"Mr\",\"honorificSuffix\":\"Er\",\"birthDate\":\"1980-11-11\",\"gender\":\"male\",\"knowsAbout\":[\"WebHosting Technical Support\"],\"knowsLanguage\":[\"English\",\"Hindi\",\"Marathi\"],\"jobTitle\":\"Level3 System Administrator\",\"worksFor\":\"PlatinumSupport.ni\",\"url\":\"https:\/\/platinumsupport.in\/blog\/author\/anand-v\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to whitelist IP address on Linux - Knowledge Base","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to whitelist IP address on Linux","og_description":"To whitelist an IP address in iptables, you need to add a rule to allow incoming traffic from that IP address. Here&#8217;s how you can do it: First, if you don&#8217;t have an existing rule to allow the specific traffic on the desired port, you&#8217;ll need to add one. For example, if you want to [&hellip;]","og_url":"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/","og_site_name":"Knowledge Base","article_publisher":"https:\/\/facebook.com\/platinumsupport.in","article_published_time":"2024-03-14T09:22:49+00:00","article_modified_time":"2024-09-21T04:36:18+00:00","author":"Anand","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Anand","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/#article","isPartOf":{"@id":"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/"},"author":{"name":"Anand","@id":"https:\/\/platinumsupport.in\/blog\/#\/schema\/person\/aa475c6a968475a732f330a12ff18ede"},"headline":"How to whitelist IP address on Linux","datePublished":"2024-03-14T09:22:49+00:00","dateModified":"2024-09-21T04:36:18+00:00","mainEntityOfPage":{"@id":"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/"},"wordCount":263,"publisher":{"@id":"https:\/\/platinumsupport.in\/blog\/#organization"},"articleSection":["cPanel\/WHM"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/","url":"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/","name":"How to whitelist IP address on Linux - Knowledge Base","isPartOf":{"@id":"https:\/\/platinumsupport.in\/blog\/#website"},"datePublished":"2024-03-14T09:22:49+00:00","dateModified":"2024-09-21T04:36:18+00:00","breadcrumb":{"@id":"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/platinumsupport.in\/blog\/how-to-whitelist-ip-address-on-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/platinumsupport.in\/blog\/"},{"@type":"ListItem","position":2,"name":"How to whitelist IP address on Linux"}]},{"@type":"WebSite","@id":"https:\/\/platinumsupport.in\/blog\/#website","url":"https:\/\/platinumsupport.in\/blog\/","name":"PlatinumSupport.in","description":"Discover Success through Expert Guidance: Dive into the PlatinumSupport Blog for Solutions and Empowerment!","publisher":{"@id":"https:\/\/platinumsupport.in\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/platinumsupport.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/platinumsupport.in\/blog\/#organization","name":"Tech Savy Systems","url":"https:\/\/platinumsupport.in\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/platinumsupport.in\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/platinumsupport.in\/blog\/wp-content\/uploads\/2024\/02\/psm-blog.png","contentUrl":"https:\/\/platinumsupport.in\/blog\/wp-content\/uploads\/2024\/02\/psm-blog.png","width":250,"height":75,"caption":"Tech Savy Systems"},"image":{"@id":"https:\/\/platinumsupport.in\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/platinumsupport.in"]},{"@type":"Person","@id":"https:\/\/platinumsupport.in\/blog\/#\/schema\/person\/aa475c6a968475a732f330a12ff18ede","name":"Anand","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/platinumsupport.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/610c86cd51134253c03e1441f07cd9c4e75bdbf5a06560ddc04e568bd85a89e5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/610c86cd51134253c03e1441f07cd9c4e75bdbf5a06560ddc04e568bd85a89e5?s=96&d=mm&r=g","caption":"Anand"},"description":"I have been working in the web hosting support industry for over 15 years as a level 3 administrator, and I am proud to hold RED HAT certification. My expertise lies in providing support for Dedicated Servers, Cloud Servers, and VPS running various Linux operating systems such as CentOS, AlmaLinux, CloudLinux, and Ubuntu. Additionally, I am proficient in working with popular control panels like CPanel, Plesk, CWP, AApanel etc.","sameAs":["https:\/\/platinumsupport.in\/blog"],"honorificPrefix":"Mr","honorificSuffix":"Er","birthDate":"1980-11-11","gender":"male","knowsAbout":["WebHosting Technical Support"],"knowsLanguage":["English","Hindi","Marathi"],"jobTitle":"Level3 System Administrator","worksFor":"PlatinumSupport.ni","url":"https:\/\/platinumsupport.in\/blog\/author\/anand-v\/"}]}},"_links":{"self":[{"href":"https:\/\/platinumsupport.in\/blog\/wp-json\/wp\/v2\/posts\/3352","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/platinumsupport.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/platinumsupport.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/platinumsupport.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/platinumsupport.in\/blog\/wp-json\/wp\/v2\/comments?post=3352"}],"version-history":[{"count":2,"href":"https:\/\/platinumsupport.in\/blog\/wp-json\/wp\/v2\/posts\/3352\/revisions"}],"predecessor-version":[{"id":3368,"href":"https:\/\/platinumsupport.in\/blog\/wp-json\/wp\/v2\/posts\/3352\/revisions\/3368"}],"wp:attachment":[{"href":"https:\/\/platinumsupport.in\/blog\/wp-json\/wp\/v2\/media?parent=3352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/platinumsupport.in\/blog\/wp-json\/wp\/v2\/categories?post=3352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/platinumsupport.in\/blog\/wp-json\/wp\/v2\/tags?post=3352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}