Can private IP address be the same as public IP address?
I checked my public ip address at , it showed me 137.189.34.166. When I typed ifconfig in terminal it showed me my private ip address is 137.189.34.166, too. Does that mean my computer is connected to the Internet directly? But it seems that I do have a router with ip address 137.189.35.254(by running route). When I run traceroute google.com, it showed me,
1 137.189.35.253
2 137.189.192.253
...The first hot it went is not 137.189.35.254 but 137.189.35.253. I'm totally confused.
My question is,
Can private IP address be the same as public IP address?
The first stop that packets should be sent to is the local router, right?
I'm not good at understanding network things. Could anyone help me?
61 Answer
You cannot have both private IPs and public IPs with a home network existing with more than one host on the network. Once you have added a router into your network, the most common IP addresses you will get usually start with 192.168.1.x or 192.168.0.x. The public IP is supplied by your ISP. If your computer is getting the public IP address there is the possibility that your MAC address of your network card maybe exposed to their service via being located in a DMZ through the firewall of your router, or you have a modem that is connected directly to your computer that is doing bridging.
More information about Public vs Private IP Addresses:
One thing that I mean by a modem being connected directly to your computer doing bridging, is that DSL Modems can support RFC 1483 Transparent bridging. When the DSL modem is set to RFC 1483, the public IP is then passed to the next network device. The DSL modem is now only used for the DSL handshake connection. The login information is now handled by the next network device whether it be a router or the computer itself.
1