Linux iptables -> is it possible?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Linux iptables -> is it possible?
# 1  
Old 11-06-2012
Linux iptables -> is it possible?

Hi!
I have a dedicated hosting working with 2 ips.

Is it possible to block all connections but 1 in all existing ports for only 1 of my ips?

I mean like, I have 2 ips for example: 190.x.x.5 and 190.x.x.6
I want that all the connections going to 190.x.x.6 in all ports get rejected but only 1 connection, my laptop ip which is (example) 80.x.x.1
# 2  
Old 11-06-2012
Yes, it is possible.
# 3  
Old 11-06-2012
Can you or anyone help me doing this iptables conf?
I have no idea how it can be done...

I can pay for the iptables conf..
# 4  
Old 11-07-2012
If I understand correctly, block everything to .6 except from 80.x.x.1

Code:
iptables -I INPUT -d 190.x.x.6 -s 80.x.x.1 -j ACCEPT
iptables -I INPUT -d 190.x.x.6 -j DROP

# 5  
Old 11-07-2012
Almost working.
It blocks all connections good, but its even blocking those comming from 80.x.x.1
# 6  
Old 11-07-2012
oh sorry, i used -I on both. that is the insert operation and adds the rule to the top (a habit)..

You'd want to use -A to append, as long as nothing is in your input chain.
Please ensure nothing else is in input chain iptables -L INPUT, and flush it, iptables -F INPUT, and then use -A in lieu of -I for the code I gave before..
# 7  
Old 11-07-2012
Yeah, its working perfect now, thanks!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Debian

Linux outbound traffic filtering with: cgroups + tc + iptables

I spent a lot of time trying to implement outbound traffic filtering with: cgroups + tc + iptables on Debian Jessie. Unfortunately there is still something wrong. The biggest issue is: - cgroups install + config - net_cls subsystem implementation - packets marking with net_cls - appropriate... (0 Replies)
Discussion started by: Novi
0 Replies

2. Homework & Coursework Questions

iptables producing 'Unknown error 18446744073709551615' inRed Hat Enterprise Linux Server 5.5

Creating a large number of rules such as 100000, iptables will produce errors after 42000 rules "iptables: Unknown error 18446744073709551615". But another machine where i have debian virtual machine I can easily run the sciprt of 100000 of rules I am waiting for your reply 4.... (1 Reply)
Discussion started by: tahirfattani
1 Replies

3. Cybersecurity

Replace Sonicwall with linux box using iptables

Hello, I am currently using a Sonicwall firewall to protect a class C network of public IP addresses. The sonicwall allows me to specify which IP's will be on the DMZ port and the remainder are on the LAN port by default. I would like to replace this Sonicwall with a linux box and use iptables... (3 Replies)
Discussion started by: richard987
3 Replies

4. Cybersecurity

[Linux] Blocking Your w00tw00ts with iptables

I noticed a few w00tw00ts in our Apache2 logfile the other day, so I thought I would write a quick post on blocking them with iptables. Feel free to improve upon any of my scripts or ideas in this thread. First of all, what is a w00tw00t and where might we find one? Well, a w00tw00t is an... (10 Replies)
Discussion started by: Neo
10 Replies

5. Cybersecurity

Help needed in IPTables firewall/router setup - Linux

HI all, I have setup IPTables firewall/Router and my home network, with address space 192.168.10.XXX Form my private network hosts, i can ping the gateway ( 192.168.10.101 ) , but the reverse is not happening. Can someone help me as of what i need to do, so that i can ping my private... (1 Reply)
Discussion started by: chandan_m
1 Replies

6. UNIX for Dummies Questions & Answers

Linux IPTABLES help

I'm new to Linux and I made a big mistake at work recently locking myself out of our own server :(. I did iptables -F first as the tutorial said and then entered the rules. I wanted to start over again so I did iptables -F and it locked us out. We had to get someone to physically restart... (0 Replies)
Discussion started by: nogumo
0 Replies

7. Linux

LINUX 9 IPTABLES and DNS

I have installed a linux 9 router/firewall and have issues with outside DNS queries making it in. here are my IPTABLE rules, can anyone make some suggestions? ETH1 is my outside facing Interface, ETH0 is my inside facing interface. Accept If input interface is not eth1 Accept If protocol... (6 Replies)
Discussion started by: frankkahle
6 Replies

8. UNIX for Advanced & Expert Users

LINUX 9 IPTABLES and DNS

I have installed a linux 9 router/firewall and have issues with outside DNS queries making it in. here are my IPTABLE rules, can anyone make some suggestions? ETH1 is my outside facing Interface, ETH0 is my inside facing interface. Accept If input interface is not eth1 Accept If protocol is... (1 Reply)
Discussion started by: frankkahle
1 Replies

9. UNIX for Dummies Questions & Answers

how to configure a linux box as a firewall using iptables

I have already compiled the kernel and configured it to run as a firewall. My computer has 2 NICs and is on two seperate networks. I can ping both networks from my computer, but workstations on one network can not ping workstations on the other. What Scripts or commands do I need to install ? (2 Replies)
Discussion started by: Deuce
2 Replies
Login or Register to Ask a Question