LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-14-2005, 06:52 AM   #1
SteveT
Member
 
Registered: Oct 2003
Location: South East UK
Distribution: Fedora Core 16
Posts: 69

Rep: Reputation: 15
SSH Through BT ADSL Connection


I am trying to set up an SSH connection to a server running FC4.
The server has two network cards. At the moment I am just trying to configure eth0.I have set the IP to 192.168.1.20 with a subnet mask of 255.255.255.0 and a gateway pointing to my ADSL router (192.168.1.254).

SSH is running on the server ok (although there is a Bind issue reported in the secure log - problem with binding to 0.0.0.0 - ssh appears to be running).

From my laptop I can ping both the internal address of the server (192.168.1.20) and the routers external address, but I can't connect via SSH. My laptop is using a different gateway on the local network to get to the net.

The ADSL router is a BT1801HG running 'wired'. I have set up the firewall on the router so that SSH is redirected to the server's internal IP (although the IP given for the server on the router is 0.0.0.0 the hardware address agrees with the eth0 card on the server)

Any ideas as to what I'm doing wrong?
Am I correct in what I am doing in the first place - I want the server to be available on the net, but secured by the firewall in the ADSL router with only SSH traffic allowed through.
 
Old 12-14-2005, 07:11 AM   #2
okmyx
Member
 
Registered: May 2004
Location: Cornwall, UK
Distribution: Ubuntu 8.04
Posts: 464

Rep: Reputation: 31
Have you changed the 0.0.0.0 addr to the internal IP addr of your server? Possibly this is the problem due to the log error.

What IP addr are you using to attempt the SSH? It should be the IP addr of the router if you are using port forwarding on the router.

One way to really lock down the firewall is to only permit external SSH access to a predefined list of IPs.
 
Old 12-14-2005, 07:54 AM   #3
SteveT
Member
 
Registered: Oct 2003
Location: South East UK
Distribution: Fedora Core 16
Posts: 69

Original Poster
Rep: Reputation: 15
IP's

Thanks for the reply.
The IP on the server (on the NIC) is 192.168.1.20. The router appears to detect any machines connected - and it's showing 0.0.0.0 for the server - although it has the correct address for my laptop (192.168.1.10). So it seems that the network card on the server and the ADSL router aren't talking to each other properly.
I have FC4 on my laptop and I can't see any difference between my laptop setup and the server in way of network card definition. Is there a chance that the second network card in the server is causing some kind of glitch (even though it is not configured)?
 
Old 12-14-2005, 08:51 AM   #4
carlmarshall
Member
 
Registered: Jan 2004
Location: North Yorkshire, UK
Distribution: Centos 5
Posts: 133

Rep: Reputation: 16
I think your router is forwarding ALL incoming packets to the server, that's why you're getting the 0.0.0.0 address. Perhaps a router reconfigure is in order here to just allow port 22.

Can you telnet to the server on port 22? You should get some response (even if gibberish). If that works internally, but not externally, then the router's not passing the packets.

If it's any help, here's my sshd_config

Port 22
Protocol 2,1
SyslogFacility AUTH
PermitRootLogin no
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/myauthkey
PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM yes
Subsystemsftp/usr/libexec/openssh/sftp-server

As you can see, I use an authorized_keys file rather than a password for authentication.

Carl.

Last edited by carlmarshall; 12-14-2005 at 08:58 AM.
 
Old 12-14-2005, 09:28 AM   #5
SteveT
Member
 
Registered: Oct 2003
Location: South East UK
Distribution: Fedora Core 16
Posts: 69

Original Poster
Rep: Reputation: 15
Carl,
I'm more confused than ever....
The local network goes through the ADSL router. I can ping and ssh via the internal address without a problem. The ADSL router firewall config only shows ssh being redirected through the firewall (no other services are listed) - but to 0.0.0.0. Obviously the 192.168.1.20 address is being recognised though as I can ping etc.

Telnet to 192.168.1.20 on 22 gives an SSH response:

telnet 192.168.1.20 22
Trying 192.168.1.20...
Connected to 192.168.1.20.
Escape character is '^]'.
SSH-2.0-OpenSSH_4.0

- but gives a timeout on the external address.

The problem --seems-- to be that the router thinks the ip of the server is 0 for ssh when port forwarding.

I'm just about to reset the router back to the factory settings and try again.
 
Old 12-14-2005, 09:33 AM   #6
carlmarshall
Member
 
Registered: Jan 2004
Location: North Yorkshire, UK
Distribution: Centos 5
Posts: 133

Rep: Reputation: 16
Steve,

There's no such host as .0 as this is the subnet address. It's almost certainly your router not passing port 22 to the correct IP.

Carl.
 
Old 12-14-2005, 11:42 AM   #7
SteveT
Member
 
Registered: Oct 2003
Location: South East UK
Distribution: Fedora Core 16
Posts: 69

Original Poster
Rep: Reputation: 15
Carl,
The problem seems to have been the router.
I had assumed that it was the linux end as that was where I had made the changes (ie I had set up the network card(s)) - so I had spent most of my time looking there - but after your mail, I simply reset the router and reentered the config and ssh firewall settings and hey presto my server appeared with the correct IP (this router auto detects the IP of all connected pcs - so you don't enter them). and I can now ssh through the external address. A minor snag is that my laptop and other PC's do not appear at all now on the router - but I can connect using the local IPs and I can ping across the internal network - so I'm not too fussed if the router's network display doesn't show them!

Thanks for your help.

(Next time, I'll look at the router first..)
 
  


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
How to tunnel SSH through a ADSL Modem? friendklay Linux - Networking 1 06-07-2005 08:42 AM
adsl connection ashley7 Linux - Networking 3 04-06-2004 08:40 AM
ssh to my box on ADSL remotely? yocompia Linux - Networking 5 09-07-2003 08:01 PM
ADSL Connection Joekool Linux - Newbie 5 01-03-2003 07:37 PM
ADSL connection. sendmehere Linux - General 1 12-13-2002 03:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:22 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration