static route how?
static route how?
Hi! Guys,
How will i add my static route permanently to my linux box i have encountered problem that everytime i reboot my machine static route has gone. That's is why i have to re type it again.
# /sbin/route add -net 192.168.5.0 netmask 255.255.255.0 gw 192.168.0.3
ThankS in advance.
Sonn
How will i add my static route permanently to my linux box i have encountered problem that everytime i reboot my machine static route has gone. That's is why i have to re type it again.
# /sbin/route add -net 192.168.5.0 netmask 255.255.255.0 gw 192.168.0.3
ThankS in advance.
Sonn
sonn33
AOA,
Dear son33,
Two methods by which it can be done are as follows
Note: Method 2 only works on RedHat.
Dear son33,
Two methods by which it can be done are as follows
Method 1.
echo "/sbin/route add -net 192.168.5.0 netmask 255.255.255.0 gw 192.168.0.3" >> /etc/rc.local
Easy and quick
Now its up to you which method will you choose.Method 2.
Create a file /etc/sysconfig/network-scripts/route-ethX where X corresponds to the network interface you wish to use the alternate route. This file deals with three fields: GATEWAY, NETMASK, and ADDRESS. Each field should have a number appended to it indicating what route it relates to. The example below shows two static routes configured for the eth0 network interface.
touch /etc/sysconfig/network-scripts/route-eth0
vi /etc/sysconfig/network-scripts/route-eth0
GATEWAY=192.168.0.3
NETMASK=255.255.255.0
ADDRESS=192.168.5.0
save and exit by :wq
then
service network restart
Note: Method 2 only works on RedHat.
Kind Regards
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com
-
- Site Admin
- Posts: 5132
- Joined: Fri May 02, 2003 10:24 am
- Location: Karachi
- Contact:
Re:
Dear sonn33,
Salam,
Duplicate post for the same question will not help you sir.
Best Regards.
Salam,
Duplicate post for the same question will not help you sir.
Best Regards.
Farrukh Ahmed
-
- Naik
- Posts: 68
- Joined: Thu Aug 07, 2008 6:09 pm
- Location: karachi
Yaseen
Hello ,
In addition to all above, please use this for changing route permenantly
------------
--> vi /etc/conf.d/net and add these lines
routes_eth1=(
"192.168.5.0 via 192.168.0.3"
)
I hope this will solve your issue
In addition to all above, please use this for changing route permenantly
------------
--> vi /etc/conf.d/net and add these lines
routes_eth1=(
"192.168.5.0 via 192.168.0.3"
)
I hope this will solve your issue
AOA,
Dear Ghulam Yaseen,
I would request you to please discuss latest topics, these topics are very old and has been discussed many times.
Hope you dont mind.
Dear Ghulam Yaseen,
I would request you to please discuss latest topics, these topics are very old and has been discussed many times.
Hope you dont mind.
Kind Regards
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com
Mudasir Mirza (RHCE)
(+971)55-1045754
http://www.crystalnetworks.org
http://www.diglinux.com
-
- Naik
- Posts: 68
- Joined: Thu Aug 07, 2008 6:09 pm
- Location: karachi
Hi ,
I am new cadet at linux PK, so i was just for knowledge and if you dont mind, you can make me correct for any issue if i am wrong. I hope you will help this CADET8)
I am new cadet at linux PK, so i was just for knowledge and if you dont mind, you can make me correct for any issue if i am wrong. I hope you will help this CADET8)
mudasir wrote:AOA,
Dear Ghulam Yaseen,
I would request you to please discuss latest topics, these topics are very old and has been discussed many times.
Hope you dont mind.
-
- Naik
- Posts: 68
- Joined: Thu Aug 07, 2008 6:09 pm
- Location: karachi
Yaseen
Yea
x2oxen wrote:Was that a first attack????kbukhari wrote:this is army and we don't help cadets except push them to make us honorable.ghulam yaseen wrote:I hope you will help this CADET8)
This is not me, this is whole LP.