# Finding out the IP Address of my Ethernet Modem



## niallerc (May 8, 2003)

Hi all,

I have a zyxel Ethernet dsl modem and I cannot telnet into it. My ISP obviously changed the default IP address, is there any way I can scan a range of IP addresses while only myself connected to the modem to establish what address the router/modem is. Would I be able to do this from the Command Line or will I need software?


ta

Nialler


----------



## LordCoven (May 8, 2003)

Few things:
1) You cannot telnet into a modem. You can, however, telnet into a computer connected to that modem.
2) If it is just a modem, then you're computer will tell you the IP address in the Internet Connect(ion?) app as well as from the command line when you ifconfig enN (where N is the number of the interface which represents the modem - if you don't know it, then try following rules can generally be taken to apply: your wired ethernet will mostly by en0, every subsequent network card installed will be after that. For example, my AirPort card is en1. If you have no built-in ethernet or other such devices, then you're modem is probably en0)
HOWEVER: when I connect directly to my DSL modem from my iBook (via the built-in ethernet) then I only see the IPv6 address from ifconfig and have to rely on the Internet Connect app for IP info.
3) If you've actually got a modem / router combo instead of a straight forward DSL modem, then you'll have to check the docs to see if it provides you with a remote admin interface. If not, you probably won't find out what IP address your ISP has given you.

Anyway, I hope that's of some help 

Cheers,

C


----------



## LordCoven (May 8, 2003)

Just to clarify 2) ... I mean, of course, the interface you are connecting to your modem with. I do this with the built-in ethernet on my iBook, which is en0.

... didn't read quite clear enough when I re-read the orig post 

C


----------



## ebolag4 (May 8, 2003)

ummmm....

couldn't you just call your ISP and ask what IP you were assigned? Unless you are specifically looking for a method of discovering it from your Mac, this seems to me the easiest path to discovery. I could be wrong though......


----------



## binaryDigit (May 8, 2003)

Do you have a plain modem, or a router?  If you have a router, then it will have two ip addresses, the one that is assigned by the isp and the one that it uses to talk to your machines.  The latter is assigned by you (or is left at the factory default).  For the Zyxel's, I believe they default to 192.168.0.1, you can also try 192.168.1.1.

Now if it's just a plain modem, then some of them do have the ability to be talked to either through telnet or browser.  Often this is a hard coded (in firmware) ip that the modem itself will respond to.  This is highly dependant on your modem, on the dsl modem that I have, it was something like 10.1.1.100.

Please provide more details on exactly what you're trying to do and what you're setup is (modem model# would be helpful).


----------



## michaelsanford (May 9, 2003)

> _Originally posted by ebolag4 _
> *ummmm....
> 
> couldn't you just call your ISP and ask what IP you were assigned? Unless you are specifically looking for a method of discovering it from your Mac, this seems to me the easiest path to discovery. I could be wrong though...... *



This is most certinaly the least efficient method of discovering the IP  That is the case for two reasons:
1) It requires you have access to support at the time you need the IP (if you need it at 2AM and support is offline, you're out of luck).
2) If you have a dynamic IP address (which you almost certianly do) and the lease expires and is renewed with a new address, or the connection is broken to the internet, or any number of things, your IP will change.

*In short*:
Assuming (posisbly incorrectly) that you have no router, all you need to do is go into the Terminal and enter *ifconfig ppp0* and you will get an output like

```
[mike@nimbus ~]% ifconfig ppp0
ppp0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1492
        inet [b]64.230.2.92[/b] --> 64.230.254.33 netmask 0xff000000
```
The portion I bolded is the IP address assigned to your computer.

Now if it looks like 192.168.2.x then you have a router, and this method won't work. You will probably need to do 'remote discovery' which involves hitting a web page that tells you your IP address (or, more specifically, the IP of your router). But then you get into port forwarding configuration on your router and a whole bunch of stuff I won't touch on unless we have to 

Just a side-note, you won't be able to use telnet to get into your computer, you'll probably have to (and should anyway) use SSH.


----------



## niallerc (May 9, 2003)

Thanks folks for the info, I'll check it out.

But it is a Zyxel 654m Prestige Ethernet DSL Modem the factory installed IP addy is 192.168.1.1 it doesn't have a serial port so I can't directly hook into it, it's supposed to have a web-configurator like most zyxels (I have one in the office which works fine which I know the ip addy of) anyway I cannot telnet into it from the command line, so therefore I'm led to believe that my isp changed the standard ip address (it is dynamic ip addressing externally but it prescribes ip addresses internally in a range ie DHCP) and it must use NAT.

Now of course I tried the easy route and phoned the ISP but they were either unable or unwilling to supply me with it,  hence my query here.

I'll try out what you have suggested above and let yiz know.

Ta

Nialler


----------



## LordCoven (May 9, 2003)

Sounds very much like its a modem / router combo. In that case, you'll have to find the admin access to it. You shouldn't have to telnet in to it to be able to access that.
I've tried to check the internet for the 654, but couldn't find it (not even on Zyxel's own site) ??

Cheers,

C


----------



## niallerc (May 9, 2003)

Sorry Coven,

It's a 645m.


----------



## LordCoven (May 9, 2003)

OK ... here's the title from the homepage:

Prestige 645 Series
Multi-Mode ADSL Bridge/Router

That does rather indicate it to be a bridge/router rather than a straight-forward modem. I'm also assuming you're connecting to it via an EtherNet cable? Basically what I'm getting at, is that your machine is not informed of the IP address you get from your ISP - only the router is.

There does appear to be management software for it:
Management
- Menu-driven user's interface for text-based management
- Optional web-based configuration
- Text-based management that can be configured locally and remotely via telnet. 

And the above snippet also explains to me why you want to telnet to it.
Here's something to try:
ifconfig en0
This should give you an inet address. It will probably be a 24 bit network address. And you're router will more likely than not be the first host on that network. Hence, if the IP address of your mac is:
192.168.0.2
then the router will be:
192.168.0.1
If you mac is:
10.0.1.2
then your router will be:
10.0.1.1

Try applying this scheme and telnetting to the resulting IP address.

Hope that works 

Cheers,

C


----------



## huck (May 9, 2003)

http://www.myip.dk/

try this link.

peace


----------



## LordCoven (May 9, 2003)

The link in the post above will give you the IP you have from your ISP. But if you want to telnet to the router for configuration purposes I would suggest using the method as explained in my previous post.

C


----------



## niallerc (May 9, 2003)

Excellent stuff lads n ladies, I'll try it out tonight before I hit the beer 

Thanks for yer help.


Nialler


----------



## michaelsanford (May 9, 2003)

Sorry, just to clarify, there is no such thing as a 'factory installed IP'; that's sort of like saying "my car's factory installed licence plate number".

Do you mean you want your ISP to tell you the entire range of IP addresses it assigns its clients?


----------



## BoneFill (May 9, 2003)

For Alcatel Ethernet Modems the IP is supposed to be *10.0.0.138* I don't know about yours but you can give it a shot... or try to change the last numbers of this IP ... I guess it shouldn't be too hard, there are only 255 chances... have fun...


----------



## binaryDigit (May 9, 2003)

Lots of excellent info from folks.  The routers ip that you use to access it (192.168.1.1) should be the same, your isp can't change it (unless they themselves telnet'ed into it and changed it.  What error are you getting when you try to telnet?  Have you tried pinging it?  Can you access it via the web interface?

The Zyxel's are the same as some of the Netgears (Zyxel makes them), and one thing about the Netgears that I have is that you can't more than one "thing" accessing the mgmt interface at a time.  So if you're logged on via telnet, you can't access via the web (or another telnet).  So check to make sure you don't still have a session open (though I would assume that after all this time that the other session would have timed out).


----------



## niallerc (May 9, 2003)

Binary,

Yeah I'd tried all those options before coming on here, I have a zyxel router and  a zywall in the office and telnet/web configure both of them all the time, which I am unable to with the prestige 645, the settings have been definitely changed by eircom's engineers and if there was a console port on it I'd get in that way but unfortunately there isn't.

Nialler


----------



## binaryDigit (May 9, 2003)

> _Originally posted by niallerc _
> *Binary,
> 
> Yeah I'd tried all those options before coming on here, I have a zyxel router and  a zywall in the office and telnet/web configure both of them all the time, which I am unable to with the prestige 645, the settings have been definitely changed by eircom's engineers and if there was a console port on it I'd get in that way but unfortunately there isn't.
> ...



Wow, sounds like the first thing you should do is to change the password on the router to keep them from mucking with it.

You can get your routers address (assuming your computer is using dhcp and you are able to do normal internet stuff) by simply doing:

route get www.apple.com

This will display some info, one of which is the gateway, which is your router.  If your outside access doesn't work, then use any ip that is not in the same subnet as your computer (e.g. 2.2.2.2).

Keep in mind that if your isp has truely been messing with your router, that they may have disabled telnet access (wouldn't make much sense, but you never know).  Did you try the web interface, does it also have problems?  Worse case scenerio is that you reset the thing to it's factory defaults, the Zyxel support site should tell you how to do this.


----------



## LordCoven (May 9, 2003)

Hi there,

Well, there is one more thing you can do (its what I do to check my router IP, but its fancy console stuff, so I hadn't mentioned it b4). Type netstat -r
You'll get something like:

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            10.0.1.1           UGSc        7        3    en1

There will be a lot more in the list, but its the default one you're interested in. The 10.0.1.1 is the intranet IP of my router in this case (and most any other AirPort wireless router for that matter). You should see something similar, and the IP of the default gateway == your router.

Cheers,

C


----------



## lurk (May 9, 2003)

Just another little info nugget many of these things can only be connected to from the internal network and not the external one so make sure that you are coming at it form the right direction.


----------



## wiz (May 9, 2003)

rename the file to *.pl (perl script)
chmod u+x <filename>
in the fnder click the file and Cmd+I (getinfo) set the open with application to "Launcher"

to run it.. double click it.

o, eh, it only works on 10.2.6!!


----------



## wiz (May 9, 2003)

here's the simple script


----------



## antadam (Aug 15, 2003)

LordSoven (sorry if i misspelled your name)...on some brands of modems you can actually telnet into them.  That's how a lot of the original ones worked (and a lot of them were hacked).


----------

