Networking Forums

Networking Forums > Computer Networking > Linux Networking > How to config router for 2 networks

Reply
Thread Tools Display Modes

How to config router for 2 networks

 
 
antiw
Guest
Posts: n/a

 
      12-18-2006, 02:48 PM
Hi,
My FC6 box has 2 networks:

First: from 172.16.8.1 to 172.16.31.254 (with several segments:
172.16.8.1-172.16.11.254, 172.16.12.1-172.15.254,...) gateway:
172.16.8.1, interface: eth0

Second: from 172.16.32.1 to 172.16.63.254 (segments:
172.16.32.1-172.16.35.254,...), gw: 172.16.36.1, interface: eth1

Using one I can access other as well, but I want to use 2 networks.

Please show me, how should I config the router?

 
Reply With Quote
 
 
 
 
Moe Trin
Guest
Posts: n/a

 
      12-19-2006, 02:31 AM
On 18 Dec 2006, in the Usenet newsgroup comp.os.linux.networking, in article
<(E-Mail Removed) .com>, antiw wrote:

>My FC6 box has 2 networks:


What is the output of '/sbin/ifconfig -a' and '/sbin/route -n'?

>First: from 172.16.8.1 to 172.16.31.254 (with several segments:


_HIGHLY_ unlikely. Much more likely to be 172.16.8.0 - 172.16.31.255

>172.16.8.1-172.16.11.254, 172.16.12.1-172.15.254,...) gateway:
>172.16.8.1, interface: eth0


172.16.8.0 - 172.16.11.255 = 172.16.8.0/22 which is a mask of 255.255.252.0
and so on. Is 172.16.8.1 the IP address of the router that has access to
all of those networks, or is it the address of "this" interface card? What
is in the file /etc/sysconfig/network-scripts/route-eth0 ?

>Second: from 172.16.32.1 to 172.16.63.254 (segments:
>172.16.32.1-172.16.35.254,...), gw: 172.16.36.1, interface: eth1


As above - and same question.

>Using one I can access other as well, but I want to use 2 networks.


This is not understandable. Is _this_ host meant to be a router? If so,
edit /etc/sysconfig/network and set the variable "FORWARD_IPV4=true"

>Please show me, how should I config the router?


Your question is not clear enough.

Old guy
 
Reply With Quote
 
antiw
Guest
Posts: n/a

 
      12-20-2006, 10:10 AM
> 172.16.8.0 - 172.16.11.255 = 172.16.8.0/22 which is a mask of 255.255.252.0
> and so on. Is 172.16.8.1 the IP address of the router that has access to
> all of those networks, or is it the address of "this" interface card? What
> is in the file /etc/sysconfig/network-scripts/route-eth0 ?

My IP: 172.16.9.219, 172.16.8.1 is IP of the router of LAN.
File route-eth0:
GATEWAY1=172.16.8.1
NETMASK1=255.0.0.0
ADDRESS1=10.0.0.0
GATEWAY0=172.16.8.1
NETMASK0=255.255.0.0
ADDRESS0=172.16.0.0


> >Using one I can access other as well, but I want to use 2 networks.

>
> This is not understandable. Is _this_ host meant to be a router? If so,
> edit /etc/sysconfig/network and set the variable "FORWARD_IPV4=true"


I mean how to config my box using command "route".
Our LAN has some domain: local (from 172.16.8.x-172.16.31.x), hackers
(from 172.16.32.x - 172.16.63.x), and others 10.x.x.x. I've connected
my box to both local and hackers, but in fact using only one connect
(local or hackers) can access to almost LAN resources. But there's
competition between 2 domains (local, hackers), thus some resources
only can be accessed by computers that have defined domain.



 
Reply With Quote
 
Moe Trin
Guest
Posts: n/a

 
      12-20-2006, 11:35 PM
On 20 Dec 2006, in the Usenet newsgroup comp.os.linux.networking, in article
<(E-Mail Removed). com>, antiw wrote:

>> What is in the file /etc/sysconfig/network-scripts/route-eth0 ?


>My IP: 172.16.9.219, 172.16.8.1 is IP of the router of LAN.
>File route-eth0:
>GATEWAY1=172.16.8.1
>NETMASK1=255.0.0.0
>ADDRESS1=10.0.0.0


Ok - there is a route to 10.0.0.0/255.0.0.0 via 172.16.8.1

>GATEWAY0=172.16.8.1
>NETMASK0=255.255.0.0
>ADDRESS0=172.16.0.0


and a route to 172.16.0.0/255.255.0.0 via the same router. This sounds
reasonable.

>>> Using one I can access other as well, but I want to use 2 networks.

>>
>> This is not understandable. Is _this_ host meant to be a router? If so,
>> edit /etc/sysconfig/network and set the variable "FORWARD_IPV4=true"

>
>I mean how to config my box using command "route".
>Our LAN has some domain: local (from 172.16.8.x-172.16.31.x),


OK - 172.16.8.x-172.16.31.x does not fall on a single CIDR route. You
would need to define this as two, using the same gateway. The first
route is '172.16.8.0/255.255.248.0' (which covers 172.16.8.0 to
172.16.15.255), and the second is 172.16.16.0/255.255.240.0 (which
covers 172.16.16.0 to 172.16.31.255).

>hackers (from 172.16.32.x - 172.16.63.x),


which would be 172.16.32.0/255.255.224.0

>and others 10.x.x.x. I've connected my box to both local and hackers,
>but in fact using only one connect (local or hackers) can access to
>almost LAN resources. But there's competition between 2 domains (local,
>hackers), thus some resources only can be accessed by computers that have
>defined domain.


That sounds more like a firewall or server configuration problem than
routing. From the 'route-eth0' file, it appears that your routing
table should look like this:

[example ~]$ /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.8.0 0.0.0.0 255.255.252.0 U 0 0 123 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 20 lo
10.0.0.0 172.16.8.1 255.0.0.0 UG 0 0 2450 eth0
172.16.0.0 172.16.8.1 255.255.0.0 UG 0 0 58 eth0
[example ~]$

because other than the directly attached 172.16.8.0/22 (and the loopback),
everything else gets routed via 172.16.8.1. But your original post said:

]My FC6 box has 2 networks:
]
]First: from 172.16.8.1 to 172.16.31.254 (with several segments:
]172.16.8.1-172.16.11.254, 172.16.12.1-172.15.254,...) gateway:
]172.16.8.1, interface: eth0
]
]Second: from 172.16.32.1 to 172.16.63.254 (segments:
]172.16.32.1-172.16.35.254,...), gw: 172.16.36.1, interface: eth1

and this is a completely different setup. For this, the routing table would
look like:

[example ~]$ /sbin/route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.8.0 0.0.0.0 255.255.252.0 U 0 0 123 eth0
172.16.36.0 0.0.0.0 255.255.252.0 U 0 0 456 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 20 lo
172.16.8.0 172.16.8.1 255.255.248.0 UG 0 0 789 eth0
172.16.16.0 172.16.8.1 255.255.240.0 UG 0 0 687 eth0
172.16.32.0 172.16.36.1 255.255.224.0 UG 0 0 543 eth1
[example ~]$

The other question you want to look at is "do all computers know how to
send packets to all _other_ computers?" But this, I mean that "this"
computer knows how to send packets (perhaps via a gateway) to reach
"that" computer, but does "that" computer know how to send thing back
to "this" one?

Old guy
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Can't access router config. Rob Morley Home Networking 0 11-27-2009 06:00 AM
Re: Can't access router config. Ian Northeast Home Networking 0 11-26-2009 03:20 PM
Help with Lynksys router and netgear router config forten5 Wireless Internet 0 09-25-2007 09:10 PM
"one or more wireless networks are available"...issue...solved...Stop AND Disable Wireless Zero Config Robert Desel Wireless Internet 1 02-28-2004 10:45 PM
DHCP server config for two networks Peter Ashford Linux Networking 2 09-26-2003 12:38 AM



1 2 3 4 5 6 7 8 9 10 11