Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    iptables FORWARD rule


    I'm running 3 virtual machines with Fedora 19. The machine B is set up with two networks adapters and provides que channel between machine A and machine C.

    The machine A IP is set to and machine C IP is set to On machine B I have one adapter with IP and another adapter with IP

    I've created this rule in machine B (it's working as a router):

    iptables -P INPUT DROP
    iptables -A INPUT -p icmp -j ACCEPT
    And so, no connections between the machines are made unless the PING that allows the communication between machine A and B.

    Now I want to create a rule in the router that allows the communication of HTTPS between the external network (machine C) and the internal network (machine A)

    I've added this rule in machine B:

    iptables -A FORWARD -o p7p1 -p tcp --dport 443 -d -j ACCEPT
    Where p7p1 is the interface on machine B that connects to machine A. I've also tried:

    iptables -A FORWARD -i p8p1 -o p7p1 -p tcp --dport 443 -d -j ACCEPT
    Where p8p1 is the interface on machine B that connects to machine C.

    Now, on machine A I do nc -l 443 and on machine C nc 443 but I'm getting Ncat: Connection timed out
    Whats wrong with my rule?

    Many thanks,


  2. #2


    Hi favolas,

    did you setup proper routing on hosts A and C,
    or is it host B default GW for both hosts?

  3. #3

    Thanks for your answer.

    Here is the "router" (machine B) routing table:

    Machine A routing table

    And machine C routing table:

    Is anything wrong?


  4. $spacer_open
  5. #4
    Hi favolas,

    According to Figure for the router "C", you do not have the proper route set for network

    GW for network is not, should be

    Packet from the host "A" will be returned over the default gateway.

    Traffic path you can check with tcpdump on each host (interface).

    Also, I do not know why host "C" has two default gateways.


  6. #5

    That was the problem..


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts