Ask Your Question
0

add IP to firewall

asked 2012-02-07 06:29:34 -0500

skipper gravatar image

Hello, I wish my IP to be accepted from my Fedora fileserver.

I added my IP in: /etc/hosts.allow and restarted the daemon: /etc/init.d/sshd restart ..but still my IP is not allowed..

Is there anything else to be done in Firewall? Can you give me the command so I can add my IP in firewall?

Thanks in advance!

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
0

answered 2012-02-09 09:56:25 -0500

ZenDark gravatar image

Double check all the following:

  1. Your remote server IP is inside /etc/hosts.allow
  2. Your remote server IP is not inside /etc/hosts.deny
  3. Your firewall is not blocking the SSH port (TCP 22)

If all of this is correct, try to execute this in your client machine:

ping <REMOTE SERVER IP>
telnet <REMOTE SERVER IP> 22

And this in the server machine (to triple check your service and firewall):

telnet <REMOTE SERVER IP> 22
edit flag offensive delete link more
1

answered 2012-02-07 08:02:04 -0500

hhlp gravatar image

updated 2012-02-07 08:02:39 -0500

you can use system-config-firewall and enable the service do you want in this case SSH other services are available.

don't forget to apply the changes...

edit flag offensive delete link more
0

answered 2012-02-07 07:32:25 -0500

kubo gravatar image

Fedora uses iptables as a default firewall so you need configure this one. If you want to enable SSH protocol (ssh daemon runs on port TCP/22) use:

iptables -I INPUT -p TCP -s 192.168.0.100 --dport 22 -j ACCEPT

where IP 192.168.0.100 is your IP adress.

You wrote about ssh only, if you want to enable other services just change port number (80 for HTTP, 20 and 21 for FTP, etc).

After this you need to save new configuration:

cp /etc/sysconfig/iptables /etc/sysconfig/iptables.orig # as a backup
iptables-save > /etc/sysconfig/iptables

(Wow, now I see that I don't know how to save it with systemd. With init there was /etc/init.d/iptbales save command)

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-02-07 06:29:34 -0500

Seen: 3,122 times

Last updated: Feb 09 '12