LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 02-07-2004, 09:00 PM   #1
Tyir
Member
 
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259

Rep: Reputation: 30
Is it possible to ssh into a box connected to linksys WRT54G


NOTE: I'm very new at this, so I might be doing something ridiculous..
I'v been trying to figure out how to ssh into my box. It is connected to my wireless WRT54G rotuer through ethernet.
I can ssh 192.168.1.103 (by the way, my coputer has a DHCP, but its been 103 for awhile, i figured i might make it if i can get this working...) on my network with no problems

If I ssh myip it just hangs intil i Control-C


I have a firewall script configured by guarddog on my box

In my router settings, I have (in Port Range Forward) port 22 to 22 with Both for TCP and UDP to 192.168.1.103

What else....
in security, i have in Black WAN requests, to have fireall enabled, and Block Anonymous Internet Requests checked off (note, i tried it with both off, but it stayed the same, so i figured it would be best with them on anyways)

I made sure when i configred my firewall that ssh was allowed, (and was on port 22)

Thanks
 
Old 02-07-2004, 09:26 PM   #2
MattOlz
LQ Newbie
 
Registered: Nov 2003
Distribution: Slackware
Posts: 19

Rep: Reputation: 0
For me on my dlink router, I can access my server from its internal IP, but not the external (like you are trying). Telnet into another computer, then try it from there, or ask someone to try it for you. I found it works for others, just not me.
 
Old 02-07-2004, 10:08 PM   #3
Tyir
Member
 
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259

Original Poster
Rep: Reputation: 30
I had just tested it on a windows comp w putty on my network, tyrign 192.168.1.103, and it timed out also....

And yea, iv asked other people to try, it still doesn't work, it times out..
 
Old 02-08-2004, 01:55 AM   #4
defubar
Member
 
Registered: Feb 2004
Location: Michigan
Distribution: Various
Posts: 55

Rep: Reputation: 15
Some interesting info here that you may be interested in.

http://www.batbox.org/wrt54g-linux.html
 
Old 02-08-2004, 10:44 AM   #5
Tyir
Member
 
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259

Original Poster
Rep: Reputation: 30
:O id rather not mess around with the linux installed on the router itself if i can avoid it.....
 
Old 02-08-2004, 05:59 PM   #6
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,785
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
Quote:
If I ssh myip it just hangs intil i Control-C
I'm assuming you mean your the IP your ISP gave you. If this is wrong, ignore what follows:


To SSH to a computer from outisde your LAN, you need to set port forwarding on your router. Get into the web software and forward port 22 to your linux box (192.168.1.103).

From within your LAN, you should be able to point directly to 192.168.1.103 without the router port forwarding set up, but from outside your LAN you must forward port 22 for SSH to work. If you can't connect from within your LAN, then something else is wrong.
 
Old 02-08-2004, 07:44 PM   #7
Tyir
Member
 
Registered: Sep 2003
Distribution: Slackware 9.1 with fluxbox
Posts: 259

Original Poster
Rep: Reputation: 30
Something else is wrong....

I changed the ip on my box to a static one, (192.168.1.166)

On my box, i can ping/ssh into it with no problem

But on the other computers on my network, now I can't ping or ssh, i guess this is a deepr problem :P


Is there something obvious I'm missing?
I have a firewall which is supposed to let ssh through, but it times out even with it off.. anyway ping should still work...

GAAAAAAAAHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

so now that i switched to a static ip for my linux box, i can't ping it with the windows computers on the network!!
Please help, i can't find this problem anywhere......
Note, i CAN connect to the internet, and i CAN ping the windows boxes, its like they just can't see me!
I have tried it with the firewall off, as well, the command for that is
cd /etc/rc.d
./rc.firewall stop
right?

If this helps, this is the output of ifconfig -a
Code:
root-22:38:32-~:ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:E0:29:3A:59:22  
          inet addr:192.168.1.166  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:27283 errors:0 dropped:0 overruns:0 frame:0
          TX packets:27084 errors:0 dropped:0 overruns:0 carrier:0
          collisions:18 txqueuelen:100 
          RX bytes:14212479 (13.5 Mb)  TX bytes:3001912 (2.8 Mb)
          Interrupt:3 Base address:0xdf80 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:121 errors:0 dropped:0 overruns:0 frame:0
          TX packets:121 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:12669 (12.3 Kb)  TX bytes:12669 (12.3 Kb)

root-22:38:34-~:

EDIT::

wohoo! i fixed it!
everything was set up ok, my firewall was being a bitch
so i turned it off, and it works
but i need a new firewall
I'm having such terrible luck with guarddo,g and i had bad luck with firestarter too..

Can someone post a good basic firewall script
I need ssh access obviously, http and IM clients and stuff

but not webserver stuff etc

thanks

Last edited by Tyir; 02-08-2004 at 10:14 PM.
 
Old 02-09-2004, 07:38 AM   #8
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,785
Blog Entries: 1

Rep: Reputation: 414Reputation: 414Reputation: 414Reputation: 414Reputation: 414
This is pretty basic......First, drop everything

iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP

Now allow things in that originate from within your computer using state matching:

iptables -A INPUT -m state --state ESTABLISHED, RELATED -j ACCEPT
iptables -A OUTPUT -m state --state NEW,ESTABLISHED RELATED -j ACCEPT

Finally, open the specific ports that you want to use from outside your box. I'll use ssh as examples:

iptables -A INPUT -p tcp --dport 22 -j ACCEPT

Alter the port line as needed to allow access to whatever other services you are running. The state matching should allow your browser and IM, but I have seen people having trouble with IM. You may need to explicitly open ports that IM needs.

The iptables tutorial is kind of a long read, but there is a wealth of info there on writing rules.

Finally, since you will be exposing services to the internet, you will definitly want to run an IDS like Snort and a file monitor like Aide or Tripwire

Last edited by Hangdog42; 02-09-2004 at 07:42 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
linksys wrt54g: Sveasoft Alchemy v1.0: problems loing on via web, can log in via ssh BaerRS General 1 10-16-2005 10:20 AM
problem with linksys wrt54g and adsl2mue duffboygrim Linux - Networking 0 04-29-2005 02:08 PM
WRT54G linksys router reefa Linux - Networking 2 03-16-2005 03:56 PM
cisco aironet 350, linksys wrt54g and suse 9.1 almost connected lobosolo Linux - Wireless Networking 9 08-05-2004 12:22 PM
SSH into Third box behind a linksys router. donk3 Linux - Networking 1 09-05-2003 01:02 PM


All times are GMT -5. The time now is 03:28 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration