Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
After setting up a TFTP/PXE system in my network, I got a working diskless client and I'm trying to setup some iptables rules on it for basic security when it runs.
Problem is, iptables seems to cut all communications with the server and thus, the diskless client is frozen. Is it necessary to setup iptables in this situation? If so, can you help me find out which rules to add/remove?
Here are my current rules:
Code:
#!/bin/sh
iptables -F
iptables -X
ip6tables -P INPUT DROP
ip6tables -P FORWARD DROP
ip6tables -P OUTPUT DROP
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -s 192.168.1.2 -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
exit 0
192.168.1.2 is my server's ip, for indication. Thank you in advance.
#!/bin/sh
iptables -F
iptables -X
ip6tables -P INPUT DROP
ip6tables -P FORWARD DROP
ip6tables -P OUTPUT DROP
iptables -A INPUT -s 192.168.1.2 -j ACCEPT
iptables -A FORWARD -s 192.168.1.2 -j ACCEPT
iptables -A FORWARD -d 192.168.1.2 -j ACCEPT
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
exit 0
It works in itself BUT, since my diskless client needs to load Xorg, it seems to hang there (The GUI, I still have access to the rest of the system). No idea why.
Haven't looked at what Xorg does on the network side for a while but you could turn the firewall off and while X is running you could use lsof to find out what it's doing. Then you could tweak your rules to match.
The system is on the TFTP/NFS server. This is my first installation of this type, I don't know if it's fully loaded into the client's ram (no other drive on the client).
I found the issue, I put the loopback interface rule BEFORE the DROP policies and it allowed X to work, so, problem solved. I'm posting the final iptables script for anyone who could need it in the future:
Code:
#!/bin/sh
iptables -F
iptables -X
ip6tables -P INPUT DROP
ip6tables -P FORWARD DROP
ip6tables -P OUTPUT DROP
iptables -A INPUT -s 192.168.1.2 -j ACCEPT
iptables -A FORWARD -s 192.168.1.2 -j ACCEPT
iptables -A FORWARD -d 192.168.1.2 -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
exit 0
I found the issue, I put the loopback interface rule BEFORE the DROP policies and it allowed X to work, so, problem solved. I'm posting the final iptables script for anyone who could need it in the future
Thanks for posting. Please mark thread "solved" as well.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.