Jump to content

ifconfig returns wrong ip address


RVDowning
 Share

Recommended Posts

I thought that ifconfig would return one's ip address in the eth0 section.

 

I have a static ip address for my DSL internet connection. However, ipconfig returns 192.168.1.96 which is not my static ip address. I had to call my internet service provider to determine what my address was.

 

Is there some other way to determine one's ip address? I am setup using DHCP if that matters.

Link to comment
Share on other sites

Your computer is undoubtedly behind a NAT router or some sort of NAT firewall. If this machine were directly connected to the Internet rather than behind the NAT firewall, then the ifconfig and route commands would show the static IP address assigned to you by your ISP.

 

You can see your ISP-assigned static IP address by going to a site like http://www.dnsstuff.com, where it shows in the upper right corner of your browser.

 

More on NAT:

http://en.wikipedia.org/wiki/NAT

http://computer.howstuffworks.com/nat.htm/

Link to comment
Share on other sites

Yeah, it's probably a combined modem/router.

 

If you are trying to ssh into your machine from the Internet, you have several things to check out, including:

 

1. The router by default probably blocks any incoming ssh requests from the Internet. So you would need to use the router's built-in configuration screens to do port forwarding (your ssh server uses port 22 by default, so you would need to configure the router to forward port 22 traffic to your machine). If you're not sure how to access the configuration screens for this device (and there may be default passwords you'll need to know about), and you don't have a manual for it, do a google on the make/model number and you'll probably find a manual out there somewhere, or maybe your ISP can provide one for you.

 

2. If you're running a firewall on your machine (e.g., shorewall), you'll need to configure it to accept tcp port 22 requests. If you read up on shorewall, you'll see that you have options to restrict access to only certain ip addresses.

 

3. You probably also need to check /etc/hosts.allow. You may need a line that says:

 

sshd:<<allowed_ip_address>>:ALLOW

 

4. If you're just trying to ssh into that machine from within a local network, then only 2 and 3 above will apply.

 

5. Of course, there are security considerations to allowing ssh requests from the Internet. You can search on keywords for techniques to minimize the risk. Lots of posts here and elsewhere about that.

 

The above is not necessarily complete. But it's a starter anyway. If you're having problems, do searches on the problem keywords, and ask further questions if you're stuck.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...