Find the answer to your Linux question:
Results 1 to 6 of 6
How do i format my ipchains command to accept syslog messages on port 504 but to redirect them to another local port, for example 1002?? is it somethinglike this?? Code: ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796

    iptables/ipchains syntax?


    How do i format my ipchains command to accept syslog messages on port 504 but to redirect them to another local port, for example 1002??

    is it somethinglike this??

    Code:
    ipchains -C input -p tcp -y -i eth0 -s 192.168.1.1 504 -d 192.168.1.1 1002
    Regards

    Andutt

  2. #2
    Linux Newbie
    Join Date
    Apr 2003
    Location
    UK, Manchester
    Posts
    147
    iptables -t nat -A PREROUTING -p tcp -s <ip address/range> -d <ip addess> --dport 504 -j REDIRECT --to-port 1002

    That will work for iptables, I am not sure if it would be similar for ipchains.

  3. #3
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    Thanks a lot....i will try that.
    Regards

    Andutt

  4. #4
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    How can i see that this chain is enabled?? With iptables -L -n i only see..

    Code:
    Chain INPUT &#40;policy ACCEPT&#41;
    target     prot opt source               destination         
    
    Chain FORWARD &#40;policy ACCEPT&#41;
    target     prot opt source               destination         
    
    Chain OUTPUT &#40;policy ACCEPT&#41;
    target     prot opt source               destination
    Which is standard right??
    Regards

    Andutt

  5. #5
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    When i check the module with lsmod it looks like this though..

    Code:
    ip_tables              15096   5  &#91;ipt_REDIRECT iptable_nat iptable_filter&#93;
    Regards

    Andutt

  6. #6
    Linux Newbie
    Join Date
    Apr 2003
    Location
    UK, Manchester
    Posts
    147
    You need to specify the table.

    iptables -L -t nat

Posting Permissions

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