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.
- hey guys i setup 3 NIC in our UBUNTU eth0 is configured for our DSL internet connection eth1 is configured for our LAN and uses 192.168.0.1. our windows networks uses 192.168.0.2 and so on... i installed a 3rd NIC in our UBUNTU and uses 192.168.0.36 and so on for a second windows network. Both eth1 and eth2 are different windows network. may goal here is to use the UBUNTU linux to access files from both different networks. but there is a problem i use 192.168.0.40 in the eth2 interface and tried to ping 192.168.0.36 but an error shows up saying not permitted. then other problems was experienced the contents of the UBUNTU network servers can be displayed and computers using the eth1 as gateway to the internet can no longer access the net.pls help me out here
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
Quote:
Originally Posted by SBN
- yes actually both eth1 and eth2 uses the same subnet (/24). so how do i properly connect 2 LAN in our UBUNTU box?
Either divide them into separate subnets, or turn eth1+eth2 into a bridge.
If the networks are separate, it seems that the easiest thing to do would be to divide up 192.168.0.0/24 into 192.168.0.0/25 and 192.168.0.128/25. That will require re-IPing some of the clients, though (in addition to one interface on the Linux box, and changing the subnet masks of both).
Making a bridge wouldn't require a change for the clients, but it's more difficult to configure on the Linux box.
-ok so the new setup would now be eth1 using 192.168.0.0/25 and eth2 using 192.168.0.0/25 or eth1 is 192.168.0.0/24 and eth2 192.168.0.0/25...or could be possible to just set eth1 to use 192.168.0.0/24 and eth2 192.168.1.1/24...
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
Quote:
Originally Posted by SBN
-ok so the new setup would now be eth1 using 192.168.0.0/25 and eth2 using 192.168.0.0/25 or eth1 is 192.168.0.0/24 and eth2 192.168.0.0/25...or could be possible to just set eth1 to use 192.168.0.0/24 and eth2 192.168.1.1/24...
Apparently you didn't look very closely at what I typed.
192.168.0.0/24 split in half becomes:
192.168.0.0/25
AND
192.168.0.128/25
Those are two different networks. A /25 is one half of a /24 network (and thus the second half starts at 256/2 = 128).
Probably the easiest thing to avoid confusing you would be do put
eth1 subnet = 192.168.0.0/24, eth1 ip somewhere between 192.168.0.1 and 192.168.0.254
eth2 subnet = 192.168.1.0/24, eth2 ip somewhere between 192.168.1.1 and 192.168.1.254
- sory i was just confused by the CIDR i thought if you devide 192.168.0.0/24 their CIDR is still /24.
- i think i will try the one that you suggested.
Quote:
eth1 subnet = 192.168.0.0/24, eth1 ip somewhere between 192.168.0.1 and 192.168.0.254
eth2 subnet = 192.168.1.0/24, eth2 ip somewhere between 192.168.1.1 and 192.168.1.254
-if i do this are they is there anything more i should configure for it to work.
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
Quote:
Originally Posted by SBN
-if i do this are they is there anything more i should configure for it to work.
Yes. You need to make sure that whatever machines are connected to eth1 and eth2 have the appropriate subnet mask and IP address for the network they are on. If you're using the Linux box for those other machines to reach the Internet, you need to make sure their default route properly points to the IP address of the interface on the Linux box that they are connected to.
- i have configured eth1 to 192.168.0.1/24 and eth2 to 192.168.1.1/24. so far there are no problems but i cant ping any ip address from 192.168.1.1/24 there is an error saying operation not permitted..
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660
Rep:
Quote:
Originally Posted by SBN
- i have configured eth1 to 192.168.0.1/24 and eth2 to 192.168.1.1/24. so far there are no problems but i cant ping any ip address from 192.168.1.1/24 there is an error saying operation not permitted..
This is from machines connected to that interface? Is there gateway (default route) set to 192.168.1.1? It needs to be set to that if you want machines on that network to route through the Linux box.
Are you running a firewall on the Linux box? What's the output of
Code:
# iptables -L
?
If you want to allow machines from one network talk to the other, you also need to enable IP forwarding.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.