Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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)?
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?
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.
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
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
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
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
Quote:
Originally Posted by Waqar Ahmed
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.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
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.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.