Solved

Linux Box DHCP Disabled

Posted on 2004-08-11
13
234 Views
Last Modified: 2010-04-20
Hello
Since I disabled dhcp in my linksys router and
Assigned an IP address to my box, I cannot access
To the shell remotely from my office using Putty!
In the router I have forwarding ports open,
The Firewalls are disabled in the box and in the router.
I don’t know What can it be this incident.
Thanks For Any Help!
0
Comment
Question by:Xtry
  • 4
  • 3
  • 2
  • +2
13 Comments
 
LVL 11

Expert Comment

by:jgiordano
ID: 11775970
using putty are you trying to telnet? or rlogin etc..

0
 

Author Comment

by:Xtry
ID: 11776586
Yes.
0
 
LVL 11

Expert Comment

by:jgiordano
ID: 11776697
which one there is a difference - there is an option when configuring putty; also what is the port
0
 
LVL 22

Assisted Solution

by:pjedmond
pjedmond earned 70 total points
ID: 11777154
In order to communicate through the firewall, you must forward port 22 for ssh, or port 23 for telnet.

The port needs to be forwarded to the ip address of the box concerned. I suspect that as the DHCP daemon had only assigned 1 address, it only had one address to forward the connections to, and therefore worked automatically?? although that dowsn't sound like a particularly sucure option to me!

You find the ip address of your box using the command:

ifconfig

However, there is another twist here:) The DHCP probably also provides the gateway address to your ethernet card that you'll have to add manually.

Assuming a reasonably standard linux box check with the command:

route

that the gateway is corectly mentioned.

To manually configure this check:
/etc/sysconfig/network-scripts/ifcfg-eth0

My entry is:


--------8X------------------
BOOTPROTO=none
GATEWAY=192.168.0.1
DEVICE=eth0
MTU=""
NETMASK=255.255.255.128
BROADCAST=192.168.0.127
IPADDR=192.168.0.100
NETWORK=192.168.0.0
ONBOOT=yes

---------8X-----------------

or use the 'route add' command to temporarily add the route for testing.

If the route is not set, then the daemon receives the request as the router forwards it correctly, but the responses never get back...hence it won't work! This routing info is often provided automatically by the DHCP server.

HTH:)
0
 

Author Comment

by:Xtry
ID: 11778258
This is what I have in My /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.100
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
NETWORK=192.168.1.1
BROADCAST=192.168.1.255
TYPE=Ethernet
MII_NOT_SUPPORTED=no
0
 
LVL 22

Expert Comment

by:pjedmond
ID: 11778763
The line NETWORK should be changed to:

NETWORK=192.168.1.0  

and you'll need to restart the eth0 interface for it to take effect.

..and the results of the:

route

command should be something similar to:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.128 U     0      0        0 eth0
127.0.0.0       *               255.0.0.0       U     0      0        0 lo
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0

Where 192.168.0.1 is my gateway router.
From the linux box, can you ping the router - shouldn't be a problem, but can you ping anything beyond the router (yahoo com?)
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 20

Expert Comment

by:Gns
ID: 11782601
Hm, I suspect you don't have a telnet server on your box... Rather likely you've got ssh though, so make doubly sure you forward the right port, and remember to check the corrrect protocol in putty.

-- Glenn
0
 
LVL 9

Expert Comment

by:e-tsik
ID: 11802933
Hi :-)

From reading your questions, I gather that you *are* able to login from the local network.

Since you have changed your ip address recently. My guess would be that you have not set the default gateway correctly. The line you see in you ifcfg-eth0 has no effect. The real default gateway is set via the file
/etc/sysconfig/network
Look for the line saying
GATEWAY=
and set the ip address of the router there.

Restart networking afterwards:
service network restart

Enjoy!
0
 

Author Comment

by:Xtry
ID: 11837186
nothing still the same
0
 
LVL 9

Assisted Solution

by:e-tsik
e-tsik earned 70 total points
ID: 11838226
Look at your
 /etc/sysconfig/network-scripts/ifcfg-eth0

You have
BOOTPROTO=static

It should have been
BOOTPROTO=dhcp

I think that this, plus the /etc/sysconfig/network should work.
0
 
LVL 20

Expert Comment

by:Gns
ID: 11838835
No e-tsik, Xtry has recently just moved all his/her machines _from_ a DHCP setup _to_ a static setup... We're trying to get that setup to work equally well as the windoze and macs s/he already have working, and in this particular case see if we can help get remote ssh through the router/firewall (perhaps NATing device?)...

I suspect that on the local LAN the machine works splendidly(?), and possibly also accessing the internet(?)...

Xtry, if you have "local" network problems, could we have (once again) the contents of /etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg-eth0, just to see the current state of those files? And the output from
ifconfig eth0
as well?

If local access is OK, but not internet, you'd need look at any routing and/or firewalling issues (on the linux boix as well as the router). This is why we'd like to look at the output from
route
.... again, just to make sure.

If no "local" problems (ie you are able to ssh from another local machine to the linux box) this is in all likelyhood a problem with the port forwarding in the linksys device.

-- Glenn
0
 

Author Comment

by:Xtry
ID: 11848841
ok here is what I have, I have decided to change the IP of my Router to 6.6.6.6 instead of 192.168.1.1

in file /etc/sysconfig/network I have this
-----------------------------
ETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=6.6.6.6
-----------------------------
in file /etc/sysconfig/network-scripts/ifcfg-eth0  I have this
-----------------------------
OOTPROTO=static
GATEWAY=6.6.6.6
DEVICE=eth0
NETMASK=255.255.255.0
BROADCAST=6.6.6.255
IPADDR=6.6.6.100
NETWORK=6.6.6.6
ONBOOT=yes
-----------------------------
the output of ifconfig eth0
-----------------------------
eth0      Link encap:Ethernet  HWaddr 00:04:5A:80:7C:51
          inet addr:6.6.6.100  Bcast:6.6.6.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:121320 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2886 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7641821 (7.2 Mb)  TX bytes:1253246 (1.1 Mb)
          Interrupt:11 Base address:0x2000
-----------------------------
0
 
LVL 20

Accepted Solution

by:
Gns earned 360 total points
ID: 11851049
> NETWORK=6.6.6.6
is still wrong... With that netmask you should have
NETWORK=6.6.6.0
and nothing else.

"Subnetting" an A-class address like this is OK, as long as one is sure that the address in private... the aclass 6.0.0.0/8 address (in which your little subnet is part) is still owned by DoD and was one of the initial addresses in the DARPA net... Perhaps not the best choice;-). Now, the 10 A-class, 172.16-32 B-classes and 192.168.0-255 are guaranteed to be "private" networks (ie not allowed on the internet), so best use one of these. Easy thing is to change the first byte from 6 to 10.
'
Could you please answer my (more or less stated) questions as to what works and what don't?

-- Glenn
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now