Results 1 to 5 of 5

Thread: pppoe ssh an iptables

  1. #1

    pppoe ssh an iptables

    here is my problem,
    I have a pppoe connection which i don't know why, once every 3-4 day wl700 reconnects?,... i don't know. The idea is that I get a new ip and the INPUT table is rewritten. Now the bad thing is that in the INPUT table I have this line:
    iptables -I INPUT -p tcp --dport ssh -j ACCEPT witch opens's ssh from wan.
    If I'm at work and want to ssh into my router, if this happens the only solution for me is to reboot the router so that rc.local might start again and open ssh from wan.
    Is there any solution for my problem so I'm not forced to reset my router?

    Opening ssh port from web doesen't work because it does something like iptables -A INPUT ...

  2. #2
    Execute a script similar to this periodically with cron:

    #!/opt/bin/bash

    lines=`/usr/sbin/iptables --list | /opt/bin/grep dpt:ssh | /opt/bin/wc -l`

    if test $lines -eq "1"; then
    iptables -I INPUT -p tcp --dport 22 -j ACCEPT
    fi


    - K.C.

  3. #3
    Quote Originally Posted by kfurge View Post
    Execute a script similar to this periodically with cron:

    #!/opt/bin/bash

    lines=`/usr/sbin/iptables --list | /opt/bin/grep dpt:ssh | /opt/bin/wc -l`

    if test $lines -eq "1"; then
    iptables -I INPUT -p tcp --dport 22 -j ACCEPT
    fi


    - K.C.
    Tks kfurge only a small problem:

    -bash-3.2# wc -l
    wc: error while loading shared libraries: wc: symbol vprintf, version GLIBC_2.0 not defined in file libc.so.6 with link time reference

    How do i fix this?

  4. #4
    -bash-3.2# wc -l
    wc: error while loading shared libraries: wc: symbol vprintf, version GLIBC_2.0 not defined in file libc.so.6 with link time reference

    Does someone know how to fix this?
    tks

  5. #5
    I'd recommend setting:

    export LD_LIBRARY_PATH=/opt/lib:/shares/lib

    in the script, like is done in rc.local.

    - K.C.

Similar Threads

  1. SSH and iptables trouble
    By tokyoturnip in forum WL-500g Q&A
    Replies: 4
    Last Post: 11-06-2006, 17:14
  2. WL-500gx WAN & LAN Filter example
    By pshah in forum WL-500g Q&A
    Replies: 1
    Last Post: 24-09-2005, 13:50

Posting Permissions

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