Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
iptables,ping, hostname and KDE Problems
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
The_Paranoid
Tux's lil' helper
Tux's lil' helper


Joined: 04 Mar 2004
Posts: 98
Location: Tübingen/Germany

PostPosted: Wed Mar 17, 2004 10:42 am    Post subject: iptables,ping, hostname and KDE Problems Reply with quote

very confusing ;)
I add iptables to default runlevel and edited hostnames. Then rebooted and KDE
didn't start anymore. Tried everything. Editing hostnames back reemerging. Didn't work. Then i tried to ping myself which didn't work either.
So i stopped itables so ping works. Result is that KDE works, too .. why that ??
How to enable ping in iptables and get rid of the .(none) at the login screen ??
dnsdomainame : ath.cx
hostname : theparanoid
hosts : 127.0.0.1 localhost theparanoid theparanoid.ath.cx

I don't have a static IP and now Network IP. So 127.0.0.1 is the only entry.
Back to top
View user's profile Send private message
avendesora
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1739
Location: Betelgeuse vicinity

PostPosted: Wed Mar 17, 2004 10:57 am    Post subject: Reply with quote

If you haven't configured iptables at all, then it probably starts up with a default "safe"
configuration: deny anything from anywhere... (That includes pings and any other type
of network traffic.)

You should read up on Gentoo Security Guide if you want to set up a firewall (Chap. 12 has iptables info).
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Wed Mar 17, 2004 11:00 am    Post subject: Re: iptables,ping, hostname and KDE Problems Reply with quote

The_Paranoid wrote:
very confusing ;)
I add iptables to default runlevel and edited hostnames. Then rebooted and KDE
didn't start anymore. Tried everything. Editing hostnames back reemerging. Didn't work. Then i tried to ping myself which didn't work either.
So i stopped itables so ping works. Result is that KDE works, too .. why that ??

Because the X server uses network sockets to connect you to it.
Without a working network config (even if only the local loopback) you won't be able to use X.

The_Paranoid wrote:
How to enable ping in iptables

Add a rule to allow ICMP traffic.
Better yet - belay configuring a full iptables firewall until you have read up on it.
It's not something you will learn in a weekend.

The_Paranoid wrote:
and get rid of the .(none) at the login screen ??
dnsdomainame : ath.cx
hostname : theparanoid
hosts : 127.0.0.1 localhost theparanoid theparanoid.ath.cx

Don't alter the localhost line.
Add a line with your external IP, like so:
Code:
10.10.10.10    theparanoid.ath.cx theparanoid

If you don't have a static IP my advice would be to add this to your startup scripts.
_________________
>>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen
Back to top
View user's profile Send private message
The_Paranoid
Tux's lil' helper
Tux's lil' helper


Joined: 04 Mar 2004
Posts: 98
Location: Tübingen/Germany

PostPosted: Wed Mar 17, 2004 11:12 am    Post subject: Reply with quote

iptable is configured to drop all Input except related,established and services like www,ftp,ssh and p2p. After adding icmp ping works, too ;)
iptables -L looks like this
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:www
ACCEPT tcp -- anywhere anywhere tcp dpt:5000
ACCEPT udp -- anywhere anywhere udp dpt:5001
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:9176
ACCEPT udp -- anywhere anywhere udp dpt:9176
ACCEPT tcp -- anywhere anywhere tcp dpt:rfe
ACCEPT tcp -- anywhere anywhere tcp dpt:5003
ACCEPT icmp -- anywhere anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


With Startup Scripts you mean adding "10.10.10.10 theparanoid.ath.cx theparanoid" to /etc/hosts ??

Thx for the answers ;)
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Wed Mar 17, 2004 11:46 am    Post subject: Reply with quote

No, you say you do not have a static IP on the box.
This means you have a DHCP setup, since it's nigh impossible to install Gentoo without any net connection.

The startup scripts allow for the dynamic assigning of nameservers and gateways - I would think assigning a hosts line when dhcp gets an IP is well within the realm of possibilities.

X uses port 6000 on the localhost by default; you may want to drop all iptables rules on the loopback interface anyway - they're kinda pointless ;-)
_________________
>>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen
Back to top
View user's profile Send private message
The_Paranoid
Tux's lil' helper
Tux's lil' helper


Joined: 04 Mar 2004
Posts: 98
Location: Tübingen/Germany

PostPosted: Wed Mar 17, 2004 12:08 pm    Post subject: Reply with quote

yep, no static IP.
But i didn't set up any DHCP either.
Quote:
I would think assigning a hosts line when dhcp gets an IP is well within the realm of possibilities.

How to do that ?? Checking IP and editing files everytime i reconect is kinda silly ... any way to do this automatically ?
How to accept traffic on port 6000 only for localhost, that the port is closed for the outside world ??
Back to top
View user's profile Send private message
adaptr
Watchman
Watchman


Joined: 06 Oct 2002
Posts: 6730
Location: Rotterdam, Netherlands

PostPosted: Wed Mar 17, 2004 1:58 pm    Post subject: Reply with quote

Code:
iptables -A INPUT -i lo -j ACCEPT

For starters.
If you enter this as the first rule of the INPUT chain you can at least use all local services.

Of course I mean automatically.
_________________
>>> emerge (3 of 7) mcse/70-293 to /
Essential tools: gentoolkit eix profuse screen
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum