Find the answer to your Linux question:
Results 1 to 6 of 6
I'm having a lot of problems getting NIS set up with our firewall. I've looked online and no one seems to have any answers. When the firewall is off, NIS ...
  1. #1
    Just Joined!
    Join Date
    Feb 2007
    Location
    Winnipeg, MB
    Posts
    14

    Logging Connection Attempts with iptables

    I'm having a lot of problems getting NIS set up with our firewall. I've looked online and no one seems to have any answers. When the firewall is off, NIS works. When it's on, it doesn't.

    I would like to know which ports NIS needs by logging connection attempts on the server, since I would swear the right ports seem open already. Right now I'm using this to generate the log entries:

    iptables -I INPUT -m state --state NEW -j LOG --log-prefix "New Connection: "
    iptables -I OUTPUT -m state --state NEW -j LOG --log-prefix "New Connection: "

    However, I think it must only work for successful connections, because I'm not seeing any new entries when I try running the NIS client on another machine (ypbind).

    Any help is greatly appreciated!

  2. #2
    Just Joined!
    Join Date
    Feb 2007
    Location
    Winnipeg, MB
    Posts
    14
    Anyone? I'd be happy with logging connection attempts with any other program as well, there must be a way...

  3. #3
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,281
    Try logging syn packets instead.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  4. #4
    Just Joined!
    Join Date
    Feb 2007
    Location
    Winnipeg, MB
    Posts
    14
    I don't know how to do that in iptables.

    However, it looks like I can get the information I need with the tcpdump program.

  5. #5
    Banned
    Join Date
    Dec 2002
    Location
    Texas
    Posts
    242
    # log telnet attempts
    #-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 23 -j LOG --log-level 7

    I have used the above to successfully log telnet attempts.

  6. #6
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,281
    Quote Originally Posted by myrdos View Post
    I don't know how to do that in iptables.

    However, it looks like I can get the information I need with the tcpdump program.
    That or wireshark would do. As to the iptables rule

    Code:
    iptables -p tcp --tcp-flags SYN -j LOG --log-prefix "New Connection: "
    If affter you have the port and it is still not working post your rules so we can see if there is an issue there.

    Quote Originally Posted by thehemi View Post
    # log telnet attempts
    #-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 23 -j LOG --log-level 7

    I have used the above to successfully log telnet attempts.
    And this will work when you know the port, but the OP was not sure if the port was the correct one that he had opened.
    He is looking for the port that his system is using to connect.

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

Posting Permissions

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