how to set up multiple IP addresses on my linux? [closed] - linux

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I'm doing some computer network homework and I'm supposed to develop some sort of Peer to Peer file sharing software, and when I wanna test it I need to run a few (5) instances on my linux/ubuntnu 11.10 . which means each one need to has a unique IP address. I heard I can do that but I dunno how. how can I have many IP addresses on a single computer? thanks

I think you are talking about two different problems:
How to assign multiple IP addresses to a single machine? That is possible, that is a standard functionality of any modern operating system. And that is also off-topic on StackOverflow. In Linux the way to persistently configure it can be very distribution-specific. ip addr add $IP_ADDRESS dev $INTERFACE is the general way, but won't survive a reboot or network reconfiguration.
How to allow an application instance use a selected one of the machine addresses? That is quite easy – you must bind your server socket to an address. Usually you will only provide a port number (the IP address set to INADDR_ANY for the standard C IPv4 socket API), but you can use any IP address on the machine there. Details depend on the API you are using.

We solved that by using some Virtual Machines.. Every VM has its own IP and it behaves like a standalone OS.
//Edit:
VirtualBox is my favourite: http://www.virtualbox.org/

If you are programming future-oriented, your program deals with IPv4 as well as IPv6. In this case, you can have several IPv6 addresses on one PC and maybe tell each instance to bind to a distinct address.

Related

Why i can't ping to any address using a static ip? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
We are provided with LAN inside our hostel, ip address starts from 172.... But few of days ago we start getting ip address of something like 192.... and internet stops working. We are told to fill static ip in setting( by seniors) in order to use internet. We did it ,internet starts working but i don't know why after that i am not able to ping anything like
wheneer i type ping 8.8.8.8 it goes into loop, there is a server inside our college with address glug.nith.ac.in whenever i try to ping that with the given name like ping glug.nith.ac.in it says
ping: glug.nith.ac.in: Name or service not known
whenever i try to ping that server with its ip address like 172...__ it again goes into loop.
SSH too not working.
Why so ? And what's going arround with network in layman term?
ping: glug.nith.ac.in: Name or service not known
is because your DNS Server is not reachable from your system. So the website you are accessing cannot be mapped into an IP address. IP address helps you to make calls to the website servers and load the response contents. Since its not reachable, you are getting Name or service not known error.
192...
This always is the local network IP address assigned to you when you are connected to a WIFI Router or other routers in LAN(Local Area Network). If these routers doesn't have any incoming internet connections, then they create their own subnet and your system will be a part of this subnet. You wont have access to the internet in most of the cases.
172...
Now this could be your IP address allowed to access the internet according to DHCP server (the server that maintains the IP address allocations and Internet accesses). Hence you are able to access the Internet.
I tried my best to keep it simple though there are lot many concepts involved here. I would recommend you to go through Data communications and networking by Behrouz A. Forouzanif are interested to know more. Hope this helps. :)

Is it possible to build 5000 IP address on a single application? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I was asked to build a simulator that pretend to be 5000 UDP clients, each with a unique IP address.
Can this simulator be a PC application?If it can, can it be build on Windows, or Linux.
Or has to build a hardware only?
Thanks
You can do this in software. There are two different approaches:
Use IP aliasing. With IP aliasing, you can create multiple virtual network interfaces that map to a single physical interface. Each interface has its own IP address. You then create a separate socket for each address and send traffic on it. See this post for more details.
Use raw sockets to "forge" UDP packets with the desired IP address. This has the disadvantage that the server cannot successfully reply to the client, since there is no network interface corresponding to the forged address. See this for instructions on how to craft UDP packets using raw sockets.

IP needed on Linux bridge between 2 TAP interfaces? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I am trying to setup openvpn on a server so that I have 2 different tap interfaces (tap0 and tap1) and then a bridge connecting those interfaces. The idea is that a client on tap0 will be able to talk to a client on tap1 and vice-versa.
There is no physical NIC involved in the bridge and the Bridge interface is setup with no ip/netmask/broadcast.
I am able to ping between the 2 when they are both connected however I see no traffic when trying to tcpdump the bridge interface.
I am a bit confused on some things:
Do I need to have an ip configured on the bridge interface at all? I don't quite see the reason for it as all it will do is to make to virtual interfaces talk to each other
Is the fact that the bridge interface does not have an assigned ip/netmask/broadcast the reason I am not able to see the ping traffic on the bridge interface when tcpdumping that interface?
If the answer to number 2 is Yes, I assume that it is not either possible to use iptables to block/allow traffic on that interface, correct? If so is there any other way to accomplish what one would do with iptables on an interface like that?
I guess this wasn't the proper place to put this question but I thought I'd put an update anyway to close the issue.
Turns out that you do not need an assigned ip address on the bridge and it is possible to tcpdump. I happened to be working in containers which made the traffic go outside the vpn when pinging.

in linux, does routing take different path on loopback vs IP assigned to NIC [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I am using RHEL 6.3 (2.6.x kernel). I have tcp based client server applications. I noticed that when i run them on the same host, the throughput is approx the same, irrespective whether server binds to loopback or local IP assigned to NIC.
What is the reason behind it? My understanding is that loopback is software based routing, where as when local IP assigned to NIC is involved, the hardware is involved in the data path. Is that true?
The hardware does not get involved.
As soon as the routing function knows that the destination address is local, the packet is switched to ingress path. Which is incidentally why sniffers can't capture such packets, because that hook happens to be after the point of this decision.

How to determine the IP of the computer that connects to me? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
Here's the scenario:
in a private network, there are only two computers connected to this private network.
Say, I am using computer A. Computer B will then connects to me and is looking at my shared folders.
If I am using computer A, how will I know the IP address of the one connecting at me? (in this case, computer B?)
please consider the two computers to be unix-based (may it be Mac OS or linux).
What will be the unix command for that? ifconfig can only show me my IP. How about the list of IPs that are connecting at me?
(additional note: I have seen this possible in my friends laptop. He's using Conky. And from there, he can determine how many are connected to that laptop. However, it only shows the number of connects, and not the actual IP.)
please help.
Use netstat
netstat -l -n
You can even see "live" information by using the -c option. The -p option can be used to determine the program that actually owns the socket.

Resources