Results 1 to 4 of 4
Thread: Linux router problem
-
06-29-2008, 03:28 AM #1New Member
- Join Date
- Jun 2008
- Posts
- 1
Linux router problem
Hi, i got one fully managed ip range from my isp around 256 ips to use on my networks. Basically i want to set up gateway, segment the 256 ips into two parts, each part with 128 ips. detail below
1, nameserver 123.123.123.2 and 123.123.123.3
3, first part gateway 123.123.123.4 and ip use from 123.123.123.5-123.123.123.128
4, second part gateway 123.123.123.129 and ip use from 123.123.123.130 - 123.123.123.255
what i am using?
centos 5.2 with vconfig installed
what i did?
1.i add the name server 123.123.123.2 and 123.123.123.3 to /etc/resolv.conf
2,i add the gateway 123.123.123.4 and 123.123.123.129 to /etc/sysconfig/network and added line" VLAN=yes"
3,i edited eth1 with following setting
#Realtek
DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
IPADDR=123.123.123.1
GATEWAY=
NETMASK=255.255.255.0
TYPE=Ethernet
4, i added eth1.2
DEVICE=eth1.2
BOOTPROTO=none
ONBOOT=yes
IPADDR=123.123.123.5
GATEWAY=123.123.123.4
NETMASK=255.255.255.0
TYPE=Ethernet
Vlan=yes
5, i added eth1.3
DEVICE=eth1.3
BOOTPROTO=none
ONBOOT=yes
IPADDR=123.123.123.130
GATEWAY=123.123.123.129
NETMASK=255.255.255.0
TYPE=Ethernet
Vlan=yes
then i restart the network
however the configuation fails to work, where did i do wrong?
-
06-30-2008, 01:46 PM #2Web Hosting Master
- Join Date
- May 2006
- Location
- India
- Posts
- 661
I think you should mask it correctly so that two range of ips are defined and they use correct gateway.
██ SparkSupport.Com - The Premier Tech Company
██ Cloud Solutions|Email Infra setup|VOIP|Video Streaming|Software Development
██ Email: info@sparksupport.com █ Phone : 1- 408-600-1449 | Skype : shijils
-
06-30-2008, 05:10 PM #3Web Hosting Master
- Join Date
- Oct 2001
- Posts
- 1,319
Hi,
Well.... a few things come to mind here.
1) Try DEVICE=eth1:X instead of DEVICE=eth1.X
2) Not sure what VLAN=YES is doing for you... try removing that
3) Remove the gateway= lines. You need to add .4 and .129 as additional IP aliases, perhaps instead of .5 and .130
4) Subnet masks should be 255.255.255.128
On the linux router you only need:
DEVICE=eth1
BOOTPROTO=static
ONBOOT=yes
IPADDR=123.123.123.4
NETMASK=255.255.255.128
DEVICE=eth1:1
BOOTPROTO=none
ONBOOT=yes
IPADDR=123.123.123.129
NETMASK=255.255.255.128
Then in /etc/sysconfig/network add "GATEWAY=123.123.123.1" where 123.123.123.1 is your ISPs gateway IP address.
That is assuming that the name servers, .2 and .3 are on a seperate machine.Avi B
-
06-30-2008, 06:02 PM #4Web Hosting Master
- Join Date
- Oct 2001
- Posts
- 1,319
Oh, and Don't forget to enable IP routing:
echo 1 > /proc/sys/net/ipv4/ip_forward
You may want to put that in /etc/rc.d/rc.local so it runs every time the server starts upAvi B