Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a local network on a router. I want to connect it to the internet using another router from my ISP. The internet router from my ISP has a static IP that can be reached from the internet. What I want to achieve is to be able to reach a client server application running on the LAN network from the internet.

LAN (192.168.1.1)
+------+------+-------+        +---------+
|      |      |       |        |         | 
PC1   PC2     PC3     LAN Router      Router from ISP (stati IP - 41.58.163.84)

The router from ISP also have the following details

subnet mask - 255.255.255.255
Default Gateway: 10.1.0.100
DNS: 41.222.70.179

After setting the internet configuration on the LAN router, when I try to save it, I get the error message that

IP address and gateway are not in the same subnet mask.

Below are my settings:

Internet IP address: 41.58.163.84 (the static IP from my ISP)
subnet mask: 255.255.255.255 (From my ISP)
Default gateway: 192.168.1.1 (Router IP, the LAN router and the internet router I'm using have the same IP which I used as the default gateway)
DNS1: 41.222.70.100

I'm not sure the Default Gateway is correct.

Please what am I doing wrong?

share|improve this question
1  
"the two routers I'm using have the same IP" That's not good. –  techie007 Sep 26 '13 at 14:45
    
Yup. And the IP address and gateway are not in the same subnet mask. is probably when the OP tries to configure 41.58.163.84 as DG on the 192.168.1.0/24 net). Still guessing though until the OP add more information. –  Hennes Sep 26 '13 at 14:47
    
@techie007 please see the edited question. –  Chibuzo Sep 26 '13 at 15:02
add comment

2 Answers

up vote 2 down vote accepted

A few other things worth trying is to set your inside router into bridge mode, which will cause it to function as a repeater rather than a router, which would save you from having to deal with 2 separate internal subnets. But if you want to allow connections to one box from the internet, this may be a bad idea as you will no longer have the extra layer of security protecting the other machines on 192.168.1.0/24.

You don't use the /24 notation when you set a default gateway, only when setting a netmask.

Basically, what the /24 at the end is telling you is where to draw the line between the network address and the host address. This all goes way back to methods that are no longer used much, but long long ago, you could get 3 classes of addresses, and what differentiated them was how many hosts you could put on a single subnet. A class A network used the first octet for the network part of the address, and the next 3 for host address. so N=network, H=host would look like N.H.H.H for class A. This allowed over 16 million hosts per subnet. Not very practical. A class B network would split the network and host halfway. N.N.H.H, the corresponding netmask would be 255.255.0.0 or FF.FF.0.0 or /16, those are just 3 ways of saying the same thing, the first one uses decimal, the second uses hex, and the third /16 is counting the number of binary ones. If you are totally confused by now, which you should be, because these different ways of saying the same thing are used pretty interchangeably and probably seems pretty random. Especially if you aren't fluent in base2 or base16 number systems. so to recap, decimal 255 is the same as saying hexadecimal FF, which can easily be converted to binary, or 11111111, which is 8 ones and may also be written down as /8 (the last /8 notation is only used for masking bits, not for much else).

If you want to reach a server on your own network from the outside, you must use a NAT, or network address translator if your ISP only assigns you a single IP address (which is taken by your modem/router). the NAT will keep track of which internal addresses are associated with certain connections going out to the internet. If you have more than one machine internally which connects to the internet, then you already have a functioning NAT in place.

What you need to do next is set up a port forward on your router/modem that will point to the IP address of your server, and the desired port. If you want to run a web server, you probably want to map all incoming connections from the internet to your modem on port 80, and forward those to your server's port 80. If you want to set up a different service, just change port 80 to appropriate port number. You may need to do this for both TCP and UDP connections. It should be fairly easy to figure out if you find the right menu on the modem/router. if all else fails, RTFM.

share|improve this answer
    
Thanks. I turned the LAN router to a repeater. I configured the port forwarding on the internet router, but I cannot connect to mysql server running on the LAN. I've posted this as a question here superuser.com/questions/650754/how-to-connect-to-mysql-remotely –  Chibuzo Sep 26 '13 at 17:30
add comment

If I read the question correct then you got a network like this:

   (LAN: 192.168.1.0/24)    (1)   (2)      (3)      41.58.163.84/32
  +--------+--------+--------+    /---------\        /----------INTERNET
  |        |        |        |    |         |        |
  PC1     PC2      PC3       Router       ISP provided 
                                          router or modem

The PCs are all all on the same LAN: 192.168.1.0/24.
That means that they have IP addresses 192.168.1.x and netmask 255.255.255.0

If they need to send information to somewhere not on the LAN then they will send it to the router. So The place marked (1) is on the same network (else you could not reach it) and is the default gateway.
As I read your question you set that to 192.168.1.1/24.

The places marked (2) and (3) need to talk to each other. So they are also on the same subnet. This is probably a different subnet than the left one, else the left router would not know where to route the packets.

To continue from here I first need to know what your right 'router' is doing.
Does it have two IP addresses? One on the outside (the 41.58.163.84/32) and a different one on the inside? If it does then you would need to configure (2) to match that inside (3) IP. Match as in: Same subnet, not same IP. And the routers DG should be set to the IP (3).

If I drew it wrong and the left side of the ISP modem/router is not IP based but e.g. fibre or DSL then the 41.58.163.84/32 is on the NIC marked (3).

Please add the relevant information to your post.

Also, please read this great post on how subnetting works.

share|improve this answer
    
192.168.1.1 means IP: 192.168.1.1 and netmask 255.255.255.0. See http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing –  Hennes Sep 26 '13 at 14:38
    
Thanks for the reply. The first network (local) has a static IP 192.168.1.30. I use it to reach a client server application. I tried setting the default gateway to 192.168.1.1/24, but the the column can't accept more than three characters. –  Chibuzo Sep 26 '13 at 14:38
    
My right router is supposed to connect the LAN to the internet. What I really want to achieve is to be able to reach a client server application running on the LAN network from the internet. The right router has a static IP that can be reached from the internet. –  Chibuzo Sep 26 '13 at 14:43
    
Could you add the schematic (and add the information you just put in these comments) to your original post? You can use the edit link to edit your own post. –  Hennes Sep 26 '13 at 14:46
    
I've added more details to my question. Thanks for your time. –  Chibuzo Sep 26 '13 at 15:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.