Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I can't access to my local sites on a fedora machine from ubuntu. In firefox I get this error: The connection has timed out

In fedora iptables I added this line:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

Also disabled selinux, but still can't connect. Why?

Edit: output of netstap -tpln:

Proto Recv-Q Send-Q Local Address               Foreign Address             State       PID/Program name   
tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN      -                   
tcp        0      0 0.0.0.0:139                 0.0.0.0:*                   LISTEN      -                   
tcp        0      0 0.0.0.0:631                 0.0.0.0:*                   LISTEN      -                   
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      -                   
tcp        0      0 0.0.0.0:445                 0.0.0.0:*                   LISTEN      -                   
tcp        0      0 :::139                      :::*                        LISTEN      -                   
tcp        0      0 :::80                       :::*                        LISTEN      -                   
tcp        0      0 :::631                      :::*                        LISTEN      -                   
tcp        0      0 :::445                      :::*                        LISTEN      - 

Output of iptables -L -n -v:

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
 9982 1956K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
    0     0 REJECT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 0 reject-with icmp-host-prohibited
    0     0 REJECT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8 reject-with icmp-host-prohibited
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           
  139  9168 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
   20 16824 ACCEPT     udp  --  *      *       0.0.0.0/0            224.0.0.251          state NEW udp dpt:5353
    0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW udp dpt:631
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:631
    0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW udp dpt:631
    0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW udp dpt:137
    0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW udp dpt:138
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:139
    5   355 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:445
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:22
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:80
   87  4524 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT 14997 packets, 16M bytes)
 pkts bytes target     prot opt in     out     source               destination
share|improve this question
    
On the Fedora host, have you started the httpd server? service httpd start. To make the server start when the system boots, chkconfig httpd on –  uther May 23 '12 at 12:33
    
Yes. apache server is running and I have no problem on host –  NPK May 23 '12 at 12:45
    
can you please provide the output of iptables -L -n -v? –  Ulrich Dangel May 23 '12 at 12:54
    
@UlrichDangel: Please see the edited post –  NPK May 23 '12 at 12:56
1  
Can you connect locally (using localhost)? Also can you connect from the other machine through any other protocol/port (ping, ssh, telnet, etc)? –  ghm1014 Mar 19 '13 at 20:53
show 5 more comments

1 Answer

Netstat ouput shows that you're only accepting connections using IPv6. You must configure your server to also bind to port 80 on address 0.0.0.0.

Fedora come with a tool that you can use to configure the firewall. Avoid messing with iptables directly.

share|improve this answer
3  
That is not necessarily true, it is possible for an AF_INET6 socket to be able to accept IPv4 connections for backwards-compatibility. It would only fail if net.ipv6.bindv6only was set or the socket was openend with the IPV6_V6ONLY option. See: tools.ietf.org/html/rfc3493#page-22 –  Cedric Aug 11 '12 at 20:28
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.