LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-28-2012, 02:55 AM   #1
Waqar Ahmed
LQ Newbie
 
Registered: Aug 2012
Posts: 6

Rep: Reputation: Disabled
Public IP behind NAT


Hi ,
I have seen a similar question before but I have a little more to ask.

I have a NAT router. There are virtual machines and physical machines available behind NAT.
I want to have SINGLE public IP available to a machine (physical or virtual) behind a NAT router. The catch is, I want the public IP assigned to router to be assigned to the single machine behind a NAT. If the IP to the router is re-assigned, the IP of the machine behind the NAT should be changed accordingly. Also I want to keep the subnet mask 255.255.255.255.
All other machines should have private IPs.

Can you please tell me if this is possible or not? If it is possible can you please point me to the appropriate resource(s)?

Thank you very much.
 
Old 08-28-2012, 03:41 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
i don't understand what you're asking here really. Many home routers can provide a "DMZ forwarding" functionality to basically expose a single machine to the internet by default, maybe that's what you're after? Is this public IP going to be ON the destination host too? Is that relevant?
 
Old 08-28-2012, 03:53 AM   #3
Waqar Ahmed
LQ Newbie
 
Registered: Aug 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks for the reply,

Well in DMZ, the system would be exposed to outside internet but the IP on the network interface will not be public. I want the IP on the network interface to exactly the same the router's IP to the outside world.
 
Old 08-28-2012, 03:55 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Why?
 
Old 08-28-2012, 04:10 AM   #5
Waqar Ahmed
LQ Newbie
 
Registered: Aug 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
I am working on developing a network, which would test a bot under different network typologies, one of them is to check it under public ip configuration. SO i have to infect a machine with bot-binary with public ip and investigate the behavior
 
Old 08-28-2012, 04:12 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
OK, so is there one public IP all in, or two? What network gear is this? A small business firewall / router would be able to route any IP through to an internal machine, where this IP would be an alias on the servers NIC, or on a fake loopback interface, but that's just down to the feature set you have at your disposal
 
Old 08-28-2012, 04:23 AM   #7
Waqar Ahmed
LQ Newbie
 
Registered: Aug 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
I only have one public IP available which would be the IP assigned to the router's WAN interface.


"A small business firewall / router would be able to route any IP through to an internal machine, where this IP would be an alias on the servers NIC"

This means that I have to change the IP tables? or the router would do it by itself?
 
Old 08-28-2012, 04:26 AM   #8
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well you can't *route* an address to somewhere else if the route is already on the local machine.
 
Old 08-28-2012, 04:32 AM   #9
Waqar Ahmed
LQ Newbie
 
Registered: Aug 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks acid_kewpie, I will have to try and see!
 
Old 09-05-2012, 01:10 PM   #10
blackbrayn
LQ Newbie
 
Registered: Sep 2012
Location: Romania
Posts: 9

Rep: Reputation: Disabled
What i think you want to do/or need it's called 1:1 nat where you redirect all trafic from one external ip (regardeless if it's the only one or not) to a ip in the "lan /private" network.

As the small explanation on the link explains both ip's are asigned to you by the isp and you require at least virtual interfaces for them if not physical.
http://wiki.untangle.com/index.php/1:1_NAT
 
Old 09-05-2012, 01:33 PM   #11
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
Quote:
Originally Posted by Waqar Ahmed View Post
I only have one public IP available which would be the IP assigned to the router's WAN interface.


"A small business firewall / router would be able to route any IP through to an internal machine, where this IP would be an alias on the servers NIC"

This means that I have to change the IP tables? or the router would do it by itself?
there are a couple of problems with this line of thought, first of all, the whole purpose of a router/NAT is to isolate two separate networks from each other, only allowing communication between the two under specific circumstances as specified by the routing tables, thus machines on the inside of the NAT would be on a different network, which would be identified by a different numbering scheme, thus any machine plugged into the internal side of the NAT with an IP address with the second scheme wouldn't be able to talk to the other computers or the router.

Second, having more than one machine identified by the same IP (you did specify you only had ONE publick IP available) would break the network, even if it WAS on the same side of the switch. (though DMZ mode on some routers seem to be able assign the public IP address to the machine assigned as the DMZ)

i would look at configuring whichever machine as the DMZ machine in your router.
 
Old 09-05-2012, 01:48 PM   #12
Waqar Ahmed
LQ Newbie
 
Registered: Aug 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Thanks for the reply blackbrayn.

I don't want to pay for a static IP. Instead I want to assign the IP assigned to me by the ISP to use inside in the test-bed
 
Old 09-05-2012, 01:53 PM   #13
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
like i said, some routers do this with the DMZ mode, otherwise, using the same IP address more than once in a network won't work IP addresses have to be unique.
 
Old 09-05-2012, 03:52 PM   #14
blackbrayn
LQ Newbie
 
Registered: Sep 2012
Location: Romania
Posts: 9

Rep: Reputation: Disabled
"I want the IP on the network interface to exactly the same the router's IP to the outside world."

NO can do , the cause public ip's are unique , that's the whole ideea.
 
Old 09-05-2012, 03:57 PM   #15
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
another way to think of this is
picture an apartment complex, it has a street address (public IP)
it also has a mail room/mail boxes(router)
but unlike a house, an apartment complex has multiple distinct units (computers behind the router)
you can tell the post office to forward all mail that isn't claimed by an occupied apartment(internal ip address) to a specific mailbox (internal ip address)
but you can't give the street address (public ip) to one specific apartment(ip address) or mail(traffic) would be undeliverable to the rest of the apartments in the complex (the rest of the computers on the network would be unreachable at best, at worst, completely cut off from the internet)

yes this is an overly simplified analogy, but hopefully it makes sense.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
public ip address from behind nat mrtwice Linux - Networking 4 09-13-2012 09:24 AM
[SOLVED] NAT 1-1 for Three Public IPs on Ubuntu debianfan Linux - Security 61 03-21-2010 10:11 PM
NAT to different Public IP's compucoder Linux - Networking 1 01-29-2009 09:26 PM
Public IP behind NAT abdul_zu Linux - Networking 12 07-08-2005 02:42 AM
NAT + public IPS (+ firestarter) Stefan Pantiru Linux - Networking 2 05-17-2005 05:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 04:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration