Switch connection not working - linux

Although some similar questions have been asked here, none of them seem to solve my problem, so I've decided to specify my case in a new question.
(Please keep in mind that I am a beginner in computer networks) I have 5 machines I want to connect to each other. I am using a switch to do so.
My first problem is that among 4 of the machines, 3 of them seem to have the same Broadcast and can hence communicate with each other. But 1 of them has a completely different broadcast and cannot communicate with any of the machines (although all 4 are connected to the same switch...). Note that all 4 machines have the Gentoo linux distribution.
Moreover, the fifth machine (which has Ubuntu linux distribution) doesn't even seem to have an ip assigned to itself. When I do "ifconfig" I don't get the eth0 interface but enp0s25 instead, where the inet addr is not specified.
I guess if I can determine the same broadcast in all 5 machines I will be able to obtain a propoer connection between the machines.
Thank you for your time

You have to check if your PCs are in the same network maybe that is the reason you have different broadcast address. Check if your IP and Netmask are correct. Read this link for more information IP Addressing and Subnetting for New Users
Example:
Network - Broadcast
192.168.1.0/24 -> 192.168.1.255
192.168.1.0/25 -> 192.168.1.127
192.168.1.127/25 -> 192.168.1.255
In the examples look like all are in the same network but in reality are in different networks/sub-networks
About you eth0 check if your interface is using a static or DHCP IP.
check the configuration file:
/etc/network/interfaces

Related

is there map for ipv4 internet?

sorry my poor title but I don't know how to express my intention.
In ipv4 there are 2**32 addresses right?
and then if I send 1024 packets per second I could check all the devices of the internet in 1165 hours to create map of the internet. with it I want to make a topology of the internet
it's not that bad, if I go with multiple computers like raspberry pie it would be more faster.
if it's not me but somewhat organization or people and they have enough time, it could even scanning all the ports of all the devices of the internet..!
is my thought a daydream? or somebody already did it? please let me know! I'm curious
If you are interested in the actual physical location of an IP address, then there are many sources compiled already available, like the one here for free. Some are more accurate(commercial ones) than others.
If you just want to know if an IP address is alive or what services are available then you are out of luck as many of these "public" IP addresses are only accessible from whitelisted sources and/or heavily protected from folks like you trying to sniff around for profiling reasons.
If you would like to map out the topology of the Internet, you could get a view of the Autonomous Systems (collection of IP network addresses typically owned by ISPs or larger corporations) by looking at publicly accessible BGP looking glasses. BGP is the protocol that controls the routing of packets on the Internet. Please note that this is very dynamic and changes frequently due to the dynamic nature of path selection algorythms.

Perform Connect on specific NIC in a two NIC Linux system

Business case:
This is year 2015, and I am using Linux kernel 3.17. My ARM Linux has two NIC, eth0 and eth1. eth0 is for configuration purpose locally for a person next to it, and eth1 is for configuration purpose from remote. So they are basically same function, except eth0 has a person to plug in the cable in the field.
Local PC ------ [eth0 My ARM Linux Computer eth1] ------ Remote PC
Using eth0, the PC software can configure eth1 IP address and port for configuration. To do that, my eth0 has a preset IP address (192.168.1.2) so the PC software can easily find it. The ARM Linux (3.17) application needs to listen on eth0 port A, and eth1 Port B (if configured), and once connected, will respond, but never initiate any activity (not even ping).
There is no connection between local PC and remote PC. They are not supposed to be bridged, or networked.
Question 1:
If eth1 is configured with same IP as eth0, will my application still able to listen on both NIC ports, and correctly respond? I will have two independent threads (maybe same function, but different parameters) to listen on the two NIC ports.
This is why I ask whether I can specify the NIC when connect, and respond, because now you can see they could have same IP address. Ideally, the OS knows where is the connect request is from, so it should know which way to reply to, even if the two NIC have same IP as long as they have different Ethernet address. But, does C++11 or Berkeley model allow me to specify eth0 or eth1 when I listen and reply?
Now, the local PC and remote PC could have same IP address as well (but different from the ARM Linux). But imagine I have two ARM Linux computers, then this configuration is completely ok. But unfortunately I only have one embedded system and one OS with eth0 and eth1.
Question 2:
If answer to question 1 is no, then can they have same subnet mask? Also, can the local PC and remote PC have same IP address?
Assumption
Setting routing table, is a solution, if works. I wanted to know whether it is feasible and also whether it is recommended not to do it.
Also, this is Linux. Similar questions were asked long time ago for Windows, and Windows XP says (no) and I am using Linux 3.17 and I have same IP address so things are different from similar questions.
At the system level, you can configure a bridge on the mediating box. This can have the same IP address on both sides of the bridge and can be locked down using iptables to only respond to particular TCP/UDP ports.
You can't have systems on both sides of the bridge with the same IP address (i.e. the local pc and remote pc can't have the same IP address). You can use ebtables to limit the access on either side of the bridge to the IP address of the bridge itself, which means that the local pc can only talk to the mediating box and the remote pc can only talk to the mediating box.
This is based on never expecting the local and remote pcs to talk to each other.
It's mostly a sys-adminny solution, though, there's not really an API that you could use as a developer to accomplish the same thing.

Is IPv6 send-to-self possible in linux

I am trying to create a setup for testing network equipment, and would like to use multiple (3) NICs in a single PC to produce traffic through an external device, i.e. a network switch. From one interface to another.
All of the tests are for IPv6 and ethernet. All NICs have link local and global IPv6 addresses with the same network/subnet prefix.
Atm. all packets are routed internally and never use the physical wire.
I see a lot of threads solving the problem for IPv4 using the net.ipv4.conf.all.accept_local parameter together with some routing table fixes. But I can't find a solution for IPv6.
Anyone know of a solution?

Accessing vitual linux-system

I have just installed an virtual Linux system. I was trying to access is from a different location but I could get trough.
When I have looked up the ip-address (ifconfig) on the system, which is:
inet addr: 10.0.2.15
but I still cant seem to manage it. Can anyone help?
It depends on virtualizing software you're using, but address pretty much looks like NATed. In that case you can't directly access it, unless you'll configure VM to map virtual network controller directly to host network.
What do you mean with different location? 10.x.x.x are private IP addresses, which can only be accessed within its subnet. What IP address does the host system have?
If the host system is within 192.168.x.x subnet, then an outside computer cannot know how to access 10.x.x.x when there is no route. You have then to set up NAT on your host computer.
A more easier approach would be to use bridged networking which will then eventually get an IP address through DHCP from your router (or whatever you might have).

Port groups and vSwitch in ESXi

In ESXi I see vSwitch and In each vSwitch I have the provision to add port-groups. Do each port-group I add is on a separate network ?
Say I configure 2 port-groups and run DHCP server on one of them. Can I isolate the DHCP broadcast to only those machines on that port-group ? Or does the DHCP broadcast reach all port-groups on the vSwitch ?
I setup 2 Linux VMs with 2 NICs each. Each of the NIC-1 is associated to PortGroupA and NIC-2 is associated to PortGroupB. And I ran a DHCP server (dnsmasq) on one of the LinuxVM on eth0 (NIC-1,PortGroupA).
I noticed that when I bring up eth1 (NIC-2, PortGroup2) on the second Linux VM it gets an IP from the DHCP running on PortGroupA.
Is this expected or is my environment messed up ?
I'm no expert but I see two ways this could work:
Use different port groups and define different VLAN-IDs for each of them. VLAN-IDs enable you e.g. to split a switch in half to create two separate networks.
Use different vSwitches that are only connected to each other through a single VM (e.g. software firewall) that provides routing between the two networks. Block DHCP traffic.
Option 2 worked fine for me using free ESXi and provides most flexibility but there might be an easier solution using ESXi features only.

Resources