Solved

How to subnet a class C IPp

Posted on 1997-04-15
5
244 Views
Last Modified: 2008-03-06
I have 1 class C ip address, I got 2 network (40 pc for 1 lan and 20 for another), if I use linux(2 lan card on it) as a router between the 2 lan(not bridge ! because I don't want  too much traffic on both lan), how to config it ?
0
Comment
Question by:rayman
  • 3
  • 2
5 Comments
 
LVL 3

Accepted Solution

by:
pc012197 earned 80 total points
ID: 1584384
Lets assume the simple case: you're going to have to subnets with IP-Numbers 1-126 for the first subnet, and 129-254 for the second. Your router will have to IP-adresses. For consistency, it will use the first IP adress in each segment. Lets assume your class C net has IP numbers 192.168.10.0 - 192.168.10.255, and the lan cards on your router are accessible as eth0 and eth1.

Set up the first subnet on eth0:

ifconfig eth0 up netmask 255.255.255.128 broadcast 192.168.10.127 address 192.168.10.1
route add -net 192.168.10.0 netmask 255.255.255.128 dev eth0

Set up the second subnet on eth1:

ifconfig eth1 up netmask 255.255.255.128 broadcast 192.168.10.255 address 192.168.10.129
route add -net 192.168.10.128 netmask 255.255.255.128 dev eth1

The machines in each subnet have to be set up with the correct netmask and broadcast adresses. The router should be the default gateway for the machines in the subnets (use the correct IP number for each subnet).

0
 

Author Comment

by:rayman
ID: 1584385
How to setup my routing table on my internet server(only on lan card on it) ? Where I have two linux, one for connecting to WAN, one for router between 2 lan.

If I get 3 lan, should I use the same configuration as mentioned,
by divided the C class IP into 3 or 4(64 IP each), with netmask 255.255.255.64,255.255.255.128, 255.255.255.192 ?
0
 
LVL 3

Expert Comment

by:pc012197
ID: 1584386
This is getting tricky. Suppose you have the following layout:

LAN1---r1---LAN2---r2---WAN

where LAN1, LAN2 and WAN are networks and r1 and r2 are your routers.

In LAN1 set the machines up for routing in LAN1 and r1 as default gateway.
r1 has to be set up for routing in LAN1 and LAN2, using r2 as default gateway.
Machines in LAN2 have to be set up for routing in LAN2. They need r1 as gateway to LAN1 and r2 as default gateway. This is the tricky part, I don't know if Windows-machines support multiple gateways.
r2 needs to be configured for WAN and LAN2, and it needs r1 as the gateway for LAN1.
If you need details, please increase the points.

Regarding your other question:
You can set up your network as 4 subnets of 64 adresses each, using netmask 255.255.255.192 and network adresses ...0 ...64 ...128 and ...192. You can also use one subnet of 128 adresses and 2 of 64.

0
 

Author Comment

by:rayman
ID: 1584387
I've try to add "route add 192.169.10.200 gw 192.168.10.1 dev eth0" on my internet server (r2), where I can ping from any ws on lan2 to the ws on lan1(192.168.10.200), but I don't want to add line by line for each ws on lan1, have you any suggest ?
0
 
LVL 3

Expert Comment

by:pc012197
ID: 1584388
On r2, you can add a routing entry for the complete subnet LAN1:

route add -net 192.169.10.128 netmask 255.255.255.128 gw 192.168.10.1 dev eth0

(I assume LAN1 has adresses ...128-255)

0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now