LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 04-24-2019, 12:58 AM   #1
novio8
LQ Newbie
 
Registered: Apr 2019
Posts: 3

Rep: Reputation: Disabled
Two network Cards


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
 
Old 04-24-2019, 01:31 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
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.
 
Old 04-24-2019, 01:51 AM   #3
novio8
LQ Newbie
 
Registered: Apr 2019
Posts: 3

Original Poster
Rep: Reputation: Disabled
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]
 
Old 04-24-2019, 03:05 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by novio8 View Post
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
Code:
ip route
 
Old 04-24-2019, 06:05 AM   #5
novio8
LQ Newbie
 
Registered: Apr 2019
Posts: 3

Original Poster
Rep: Reputation: Disabled
I'v run ip route, result is bellow

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 View Post
It should. Can you show me the routing table? The command is
Code:
ip route
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
two network cards - one for local network, one for http/vsftpd server scottster Linux - Networking 1 01-20-2005 08:52 PM
Two network cards = network problem filch Linux - Networking 3 01-04-2005 02:06 AM
two monitors / two cfx-cards Espique Fedora 1 05-20-2004 01:20 AM
Two networks, two network cards, one PC Deffe Linux - Networking 5 11-03-2003 01:00 PM
Two Video Cards...Two Monitors ==> :S VIP3R Linux - Hardware 5 03-16-2003 03:47 PM

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

All times are GMT -5. The time now is 07:37 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