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 home router. I have taken a broad band connection from a ISP.

When I google "what is my IP", I get an IP address. So I assume that is my public IP address. When I do ifconfig on my Linux box, I get a class C private IP, say 192.168.1.4. I understand that my router has assigned this local IP to me.

I access my router on 192.168.1.1 from my Linux box. I also understand that my router has 2 NICs. One facing the local network (with 192.168.1.1) and the other public facing. The public facing NIC has an IP, say 10.a.b.c which is not the same as my public IP.

So should the public facing NIC not have the same address as reported by googling "what is my IP"? If not, why? And when I do a traceroute to google.com, the 1st hop is 192.168.1.1, second should, in this case, be 10.a.b.c right? But it is not. It is something else. Why is it so?

(All discussion here is in respect to IP v4.)

share|improve this question
    
Your public IP will be the the WAN on your router. You only need to use one NIC on your computer and if it is plugged into the router, it will always be private. You don't have a public NIC and a private NIC, you just have two NICs. –  MaQleod May 20 '13 at 4:00
    
ok i have 2 NICs. The NIC that has a private IP is the one that I get connected to from my local network. But what about the second NIC? Why does it get assigned a class A private IP ? –  geek_ji May 20 '13 at 4:10

2 Answers 2

up vote 0 down vote accepted

Traceroute traces a packets journey or its "hops" through routers. Every time a packet encounters a router in its voyage the hopcount goes up by 1.

Even though your packet traversed two networks via a NAT'd connection, they exist on a single router and thus is considered a single hop by traceroute.

share|improve this answer
    
ok that makes it clear as to why trace route does not mark the second hop on the public facing NIC (beacuse both the NICs are on the same router). But the part that says "The public facing NIC has an ip, say 10.a.b.c which is not the same as my public IP. So should the public facing NIC not have the same address as reported by googling "what is my ip" ? If not, why ? " is not clear. Would you please throw some light on this as well....! –  geek_ji May 20 '13 at 4:13
    
your ISP is using an RFC1918 network internally (the 10.a.b.0\8) and at some point your traffic is translated to use a publicly routable address, which is what google sees. a 10.0.0.0/8 address is private only, like 192.168.0.0/24 and 172.16.0.0/16, and will not routed to the wan. –  Frank Thomas May 20 '13 at 4:23
    
thank you @FrankThomas. It was a really nice explanation .. simple and apt. But here it brings me to another doubt. Ok, as per the standards, one should use ip from a private ip range for internal networks, right? So that means I can assign a class A private IP to my computer as well. Is it possible to assign the same class A private IP to my computer as the onc that's assigned to my public facing NIC by my ISP ? I suspect so because my router has 2 completely diffrent NICs. –  geek_ji May 20 '13 at 4:39
    
A router should have a WAN and LAN port, each will have it's own unique IP. On most home grade routers, the LAN is internally connected to a switch and there are 2-4 ports on that switch. The WAN port will have your public IP and the LAN port will be your default gateway for your private network, so it will be a private IP. The WAN may not actually be a public IP, not all ISPs hand those out (but most should). It would help to see a cabling diagram noting each device and NIC in order to tell what might be going on. –  MaQleod May 20 '13 at 5:07
    
@MaQleod nice explanation. Thanks for that. But could you please tell something about " Is it possible to assign the same class A private IP to my computer as the onc that's assigned to my public facing NIC by my ISP ? I suspect so because my router has 2 completely diffrent NICs" –  geek_ji May 20 '13 at 5:36

If the IP address assigned to the WAN port on your router is public (not one of the networks defined in RFC1918), yet you're still getting a different IP when you use the web tool, then it may be because your ISP is using a web proxy service. Try using an alternative method to determine your IP address. Here is one way:

At a cmd prompt, or a Terminal window, telnet route-server.cerf.net

You will connect, get a message about appropriate use, and possibly a kerberos error message. Hit return.

At the route-server> prompt, enter who then hit return.

The output will provide a list; the entry with a * next to it will be your session, and your IP will be the last column.

share|improve this answer

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.