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.
New to Linux, so ...
I have two network cards, the first is connected to Router and internet, the secon
has a WebCam attached. The broblem is that I can't access WebCam from other
Computers on the network.
First network Card has IP 192.168.0.6, the second card has an IP 192.168.0.116
I enabled net.ipv4.ip_forward=1 by editing /etc/sysctl.conf
I can ping locally both cards and WebCam.
From network PC I can ping both NC, but not the WebCam
I used Network Manager to set both Network Cards
Please help
Your problem has nothing to do with Linux, but everything with IP and Ethernet.
When another device on your network tries to access the webcam, it will see that its address 192.168.0.xyz is on the same network. This means that traffic to this address will not be routed. Instead, the device sends out an ARP request "who has 192.168.0.xyz?", hoping for a reply that contains the webcam's MAC address.
Since the webcam is on a different network, it doesn't get the ARP request, and the device doesn't get an ARP reply.
How to solve this? Use a different address range on the network to which the second card is connected. For example, instead of 192.168.0.116, give the card an address of 192.168.1.116. Of course, the webcam needs to have an address in the 192.168.1 range as well.
A different approach might be bridging the two NICs. One side-effect: The NICs would lose their IP addresses, and the address of the first NIC would be assigned to the bridge. If you do it this way, your Linux box is not a router but a switch, but I am not certain it works.
Last edited by berndbausch; 04-24-2019 at 01:35 AM.
thank you berndbausch,
I started with first NC' IP 192.168.0.6 and the second with IP 192.168.1.116
And the result was the same.
I thought that if I enable net.ipv4.ip_forward=1
than the traffic will pass between both Cards
QUOTE=berndbausch;5988013]Your problem has nothing to do with Linux, but everything with IP and Ethernet.
When another device on your network tries to access the webcam, it will see that its address 192.168.0.xyz is on the same network. This means that traffic to this address will not be routed. Instead, the device sends out an ARP request "who has 192.168.0.xyz?", hoping for a reply that contains the webcam's MAC address.
Since the webcam is on a different network, it doesn't get the ARP request, and the device doesn't get an ARP reply.
How to solve this? Use a different address range on the network to which the second card is connected. For example, instead of 192.168.0.116, give the card an address of 192.168.1.116. Of course, the webcam needs to have an address in the 192.168.1 range as well.
A different approach might be bridging the two NICs. One side-effect: The NICs would lose their IP addresses, and the address of the first NIC would be assigned to the bridge. If you do it this way, your Linux box is not a router but a switch, but I am not certain it works.[/QUOTE]
thank you berndbausch,
I started with first NC' IP 192.168.0.6 and the second with IP 192.168.1.116
And the result was the same.
I thought that if I enable net.ipv4.ip_forward=1
than the traffic will pass between both Cards
It should. Can you show me the routing table? The command is
default via 192.168.0.1 dev enp3s0 proto static metric 20101
169.254.0.0/16 dev enp3s0 scope link metric 1000
192.168.0.0/24 dev enp3s0 proto kernel scope link src 192.168.0.6 metric 101
192.168.1.0/24 dev enp5s0 proto kernel scope link src 192.168.1.116 metric 102
regards
Mario
Quote:
Originally Posted by berndbausch
It should. Can you show me the routing table? The command is
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.