LinuxQuestions.org
Visit Jeremy's Blog.
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 06-19-2015, 06:08 AM   #1
rgto
LQ Newbie
 
Registered: Dec 2006
Posts: 7

Rep: Reputation: 0
Lightbulb Creating a new router under a existing lan


Hello there! First of all I need to show my environment, this is my LAN:
Code:
[root@Server1 ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.28.0       0.0.0.0         255.255.252.0   U     0      0        0 eth0
link-local      0.0.0.0         255.255.0.0     U     0      0        0 eth0
default         10.0.28.1       0.0.0.0         UG    0      0        0 eth0
[root@brasilia ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:14:5F:33:2E:87
          inet addr:10.0.28.5  Bcast:10.0.31.255  Mask:255.255.252.0
...
Into this LAN, I've created a new CentOS7 server to make a new subnet 192.168.128.0/22 under this 10.0.28.0/22. I need do this new subnet clients (eg. a PC setted to 192.168.128.20/22) communicate with 10.0.28.0/22 LAN, and inverse the same. I need both LANs communicate between themself.

At this new CentOS7 server, I have enp0s3 (ethernet1) with IP 10.0.31.200/22 and enp0s8 (ethernet2) with IP 192.168.128.1/22 setted. This CentOS7 server looked like this:

Code:
[root@CentOS7 ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.0.28.5       0.0.0.0         UG    1024   0        0 enp0s3
10.0.28.0       0.0.0.0         255.255.252.0   U     0      0        0 enp0s3
192.168.128.0   0.0.0.0         255.255.252.0   U     0      0        0 enp0s8
I've done "echo 1 > /proc/sys/net/ipv4/ip_forward", then my PC 192.168.128.20 now can ping 10.0.31.200 and 192.168.120.20, but I can't reach any other computer from 10.0.28.* and who is on 10.0.28.* can't reach any computer into 192.168.128.*!

What I need to do? Thanks!

Last edited by rgto; 06-19-2015 at 07:21 AM.
 
Old 06-19-2015, 06:17 AM   #2
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Originally Posted by rgto View Post
At this new CentOS7 server, I have enp0s3 (ethernet1) with IP 10.0.31.200/22 and enp0s8 (ethernet2) with IP 192.168.128.1/22 setted. This CentOS7 server looked like this:

Code:
[root@CentOS7 ~]# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         10.0.28.5       0.0.0.0         UG    1024   0        0 enp0s3
10.0.28.0       0.0.0.0         255.255.252.0   U     0      0        0 enp0s3
192.168.120.0   0.0.0.0         255.255.252.0   U     0      0        0 enp0s8
See the highlighted part of your post that I have quoted?

Is one of those a typo in your post here or have you actually got them wrong on the system, as those don't match.
 
Old 06-19-2015, 07:21 AM   #3
rgto
LQ Newbie
 
Registered: Dec 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Oh I'm sorry, I typed wrong here, the correct is 192.168.128.0 where you mentioned. I'll fix it here.

But the problem is the same. One thing I forgot to mention: if i'm in this new CentOS7 system, I can ping both subnets.

Last edited by rgto; 06-19-2015 at 07:23 AM.
 
Old 06-21-2015, 03:30 AM   #4
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
Ok so the machine in the middle can see both networks ok?

Once you have a yes to that move on ....

Q. How do machines on each network know how to get to the other network?
A. Via routing tables

A shortcut is to add a fixed route on the default gateway device on each network pointing back to the machine in the middle
The long way is to do the same to each machine on the network
 
1 members found this post helpful.
  


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
[SOLVED] Slackware router: lan eth1 works, lan eth2 doesnt! Iptables config issue slugman Linux - Networking 2 06-21-2011 01:37 AM
[SOLVED] Use existing swap instead of creating a new one. lupusarcanus Slackware 5 12-22-2009 10:33 PM
Creating a bridge from ADSL router to WLAN router linuxlainen Linux - Networking 7 02-12-2009 11:20 AM
Adding new Linux firewall/router on network with pre-existing gateway/router grittyminder Linux - Networking 4 08-13-2008 02:17 AM
Routing LAN -> WAN -> LAN with unhelpful router synx13 Linux - Networking 2 06-14-2004 02:35 PM

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

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