LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-26-2014, 10:01 AM   #1
Sum1
Member
 
Registered: Jul 2007
Distribution: Fedora, CentOS, and would like to get back to Gentoo
Posts: 332

Rep: Reputation: 30
Multiple Subnets on 1 ethernet LAN segment


I must be missing some simple part of the configuration process, but I can't find it myself.

||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

I have a Gentoo Server connected to LAN.
The LAN is a production environment so I want to be careful with testing some items on the Gentoo Server.
I've set up a static ip in the the /etc/conf.d/net:

Code:
config_eno1="10.10.0.1 netmask 255.255.255.0 broadcast 10.10.0.255"
routes_eno1="default via 192.168.1.1
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

The dhcp server/routerbox controlling the LAN runs slackware 14.
I've added the following rules to the iptables firewall:

Code:
iptables -t filter -I INPUT -i eth1 -s 10.10.0.0/24 -j ACCEPT
iptables -t filter -I FORWARD -i eth1 -s 10.10.0.0/24 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0((eth0 is the internet-facing ethernet)) -s 10.10.0.0/24 -j MASQUERADE
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

Also, in case the dhcp server is an issue, I added a 10.10.0.0/24 segment to it:

Code:
subnet 10.10.0.0 netmask 255.255.255.0 {
  range 10.10.0.1 10.10.0.100;
  }
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

I've rebooted the Gentoo Server.
I've stopped and re-started dhcpd and iptables services on the Slackware router.

When I try to ping the router from Gentoo server:
Code:
connect: Network is unreachable
When I try to ping the Gentoo server from the router:
Code:
10 packets transmitted, 0 received, 100% packet loss, time 8997ms
What am I missing to get a 10.10.0.1 device to reach the internet on a LAN segment in the 192.168.1.0/24 range?

Thank you for your help.
 
Old 08-26-2014, 12:32 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,208

Rep: Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284Reputation: 1284
There are two independent subnets running on your LAN, but you have not indicated that you have anything routing packets between them. That doesn't happen by magic. Telling the Gentoo server to use 192.168.1.1 as a gateway does not tell it what interface to use. It is complaining that it has no interface on that subnet, which is true.
 
Old 08-26-2014, 01:04 PM   #3
Sum1
Member
 
Registered: Jul 2007
Distribution: Fedora, CentOS, and would like to get back to Gentoo
Posts: 332

Original Poster
Rep: Reputation: 30
Smallpond, I appreciate your methodical prose.
Alas, I'm a little too dense to deduce the solution.

Are you saying, in addition to declaring a default gateway for ethernet device eno1, I also need to declare a path from the gateway to/through the other subnet?

Would this require "ip route add __________" on the Gentoo server?

Thank you for your time.
 
Old 08-26-2014, 07:59 PM   #4
Sum1
Member
 
Registered: Jul 2007
Distribution: Fedora, CentOS, and would like to get back to Gentoo
Posts: 332

Original Poster
Rep: Reputation: 30
I've been doing some more googling and I think maybe you were telling me my configuration will not work.
It IS possible to route tcp/ip packets between ethernet devices on two different subnets, but you can't put an x.x.x.x address on a y.y.y.y subnet and route it anywhere.

Am I understanding correctly?
Please confirm if you have a min.
Thanks for your help.
 
  


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
How to set up terminal over local LAN segment? RileyTheWiley Linux - Networking 1 12-28-2012 04:56 AM
segment the internet speed for subnets bilux Linux - Server 1 05-28-2011 11:50 AM
[SOLVED] Multiple ethernet/LAN problem arnab_das Linux - Networking 8 12-12-2010 01:05 PM
How can two seemingly different subnets on the same segment talk toeach other? jdavis2 Linux - Networking 5 07-04-2008 11:42 PM
2 subnets on the same network segment robadawb Linux - Networking 5 11-16-2005 03:42 PM

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

All times are GMT -5. The time now is 12:10 PM.

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