Two NICs second nic plugs into a switch with no router
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.
Two NICs second nic plugs into a switch with no router
I have two nics each setup with a private address.
Nic 1. its setup for 10.166.200.50/24
Default gateway of 10.166.200.1
Nic 2. setup for 192.168.1.10/24 no default gateway.
This nic is just plugged into a switch with other machines that are on the same 192.168.1 range. There is no router
The issue that I have is that if I try to ping any of these machines I get network destination host unreachable.
so I attempted to give it an IP for the default 192.168.1.0 this did not work either.
Sorry, but just to clarify I am making the following assumptions:
You can ping external addresses via the default gateway.
You can ping the router
You can ping 192.168.1.10 (nic 2)
You can't ping 192.168.1.20 (assuming a machine on that IP exists)
What's in your routing table? Is there a static route set?
I can ping outside addresses, I can also ping the router. I can ping the ip on the second nic I just cant ping anything that the switch is connected to like 192.168.1.20
After looking at this it seems that everything is routing to the 10 subnet
nope, it means that it can't resolve arp for 192.168.1.20 (or whatever you're trying to ping)
10.166.200.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
the routes look right, so you don't need to add any static routes.
to prove to yourself that the packets are being routed correctly, run a packet capture on eth1
$ sudo tcpdump -n -i eth1 arp or icmp
and from another prompt try to ping some addr on the 192.168.1.x subnet. If you see arp requests sent and no responses, then you have a layer 1 or 2 problem (switch/hub/cable) or are trying to ping a non-existent address.
then try pinging 192.168.1.1 from the *other* machine and watching the same packet capture. do you see the arp or icmp packets? then you have a connectivity problem.
I did what you asked and the node one (192.168.1.10 did as expected when I attempted to ping node two. However when I pinged from node two to note one I did get this as a response
(15:00:04.090058 arp reply 192.168.1.10 is-at 00:1c:c4:eb:80:2e) I would assume that this indicates that layers one and two are functioning however from node two I still get destination network is unreachable. However I have learned a new cool tool to use thank you
if you're getting an arp 'is-at' pkt then the target is respoding on layer 2. however note that your ifconfig output indicates that eth1 is configure as .1, not .10 so I'm not sure I've got a correct picture of your setup.
another good tool for troubleshooting layer 2 issues is arping
from node 1
$ sudo arping -I eth1 192.168.1.20
from node 2
$ sudo arping -I eth0 192.168.1.10
if you get a reply each way then your layer 2 is ok. if you don't then check cables, hubs, nics etc. I'm guessing it fails in at least one direction.
The issue with this was I have a gig nic and it is plugged into a gig port but it will not communicate properly. to resolve this i put it in a 100 full port and that resolved my issue. I am going to need to resolve this issue however for now I am up and running
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.