Re: [CentOS] Centos 6 - Persistant static routes
On 03/12/2015 08:46 PM, Scott Robbins wrote: On Thu, Mar 12, 2015 at 01:43:27PM -0400, Robert Moskowitz wrote: I know how to use 'ip' to set up a static route, e.g.: ip route add 192.168.128.0/17 via 40.53.24.3 dev eth0 But if you reboot or restart network, you loose this. Thus you have to make it persistant. I found: http://www.cyberciti.biz/tips/configuring-static-routes-in-debian-or-red-hat-linux-systems.html where it says to add to ifcfg-eth0: 192.168.128.0/17 via 40.53.24.3 But this did not work after the interface was restarted. So what is the proper to set up persistant static routes? Are you using NetworkManager? I think you have to specifically remove it although I am not quite sure when RH made it the default (nor am I sure if it would override routes, but it frequently seems to cause issues.) No NetworkManager on these systems. Also, the article doesn't say add the lineifcfg-eth0. The article says add it to route-eth0. Was that just a typo on your part? Misread on my part. My dyslexia at work (have to have something to blame!). ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Centos 6 - Persistant static routes
On Thu, Mar 12, 2015 at 01:43:27PM -0400, Robert Moskowitz wrote: > I know how to use 'ip' to set up a static route, e.g.: > > ip route add 192.168.128.0/17 via 40.53.24.3 dev eth0 > > But if you reboot or restart network, you loose this. Thus you have > to make it persistant. I found: > > http://www.cyberciti.biz/tips/configuring-static-routes-in-debian-or-red-hat-linux-systems.html > > where it says to add to ifcfg-eth0: > > 192.168.128.0/17 via 40.53.24.3 > > But this did not work after the interface was restarted. So what is > the proper to set up persistant static routes? > Are you using NetworkManager? I think you have to specifically remove it although I am not quite sure when RH made it the default (nor am I sure if it would override routes, but it frequently seems to cause issues.) Also, the article doesn't say add the lineifcfg-eth0. The article says add it to route-eth0. Was that just a typo on your part? -- Scott Robbins PGP keyID EB3467D6 ( 1B48 077D 66F6 9DB0 FDC2 A409 FA54 EB34 67D6 ) gpg --keyserver pgp.mit.edu --recv-keys EB3467D6 ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Centos 6 - Persistant static routes
On Thu, Mar 12, 2015 at 3:16 PM, Robert Moskowitz wrote: > >> > What I really need to do is get RIP working on that router and get my > servers to listen to RIP... > > One leap at a time! The usual quick-fix in a small network is to make your default router know about everything else. That is, your internet-facing router knows the route to your internal router - and vice versa. Then if you send to a single default and have a destination address that the other router on the same network should handle, it will forward the packet for you _and_ send you an icmp redirect telling you that it will save time if you send to the other router yourself. That way the computers don't have to participate in real routing protocols. -- Les Mikesell lesmikes...@gmail.com ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Centos 6 - Persistant static routes
On 03/12/2015 04:12 PM, Les Mikesell wrote: On Thu, Mar 12, 2015 at 3:01 PM, Robert Moskowitz wrote: where it says to add to ifcfg-eth0: 192.168.128.0/17 via 40.53.24.3 That’s only for RHEL 7: http://goo.gl/AtjIyI Aside from being irritating, that's just wrong. I'm using that syntax on Centos5, AH, I think I see what I did wrong. I put that line in the ifcfg-eth0 when according to this page, it goes in the route-eth0 just like the old format. I will give that a try tomorrow... Yes, I missed that part. You can put a default gateway in the ifcfg- file with GATEWAY= but if you have more than one NIC you should only have one GATEWAY= entry for the NIC facing that router, and any routes in a route-xxx file should be through a router where the next hop specified is reachable though the xxx-named interface. The routes are added as the interfaces are brought up and will fail if the gateway specified isn't reachable - as might happen if they need to go through an interface that isn't up yet. If you only have one interface you don't have to worry about that - the default GATEWAY= can be in ifcfg-eth0 and the static route(s) through a different router on the same subnet go in route-eth0. What I really need to do is get RIP working on that router and get my servers to listen to RIP... One leap at a time! ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Centos 6 - Persistant static routes
On Thu, Mar 12, 2015 at 3:01 PM, Robert Moskowitz wrote: > > > where it says to add to ifcfg-eth0: > > 192.168.128.0/17 via 40.53.24.3 >>> >>> That’s only for RHEL 7: http://goo.gl/AtjIyI >> >> Aside from being irritating, that's just wrong. I'm using that >> syntax on Centos5, > > > AH, I think I see what I did wrong. I put that line in the ifcfg-eth0 when > according to this page, it goes in the route-eth0 just like the old format. > I will give that a try tomorrow... > Yes, I missed that part. You can put a default gateway in the ifcfg- file with GATEWAY= but if you have more than one NIC you should only have one GATEWAY= entry for the NIC facing that router, and any routes in a route-xxx file should be through a router where the next hop specified is reachable though the xxx-named interface. The routes are added as the interfaces are brought up and will fail if the gateway specified isn't reachable - as might happen if they need to go through an interface that isn't up yet. If you only have one interface you don't have to worry about that - the default GATEWAY= can be in ifcfg-eth0 and the static route(s) through a different router on the same subnet go in route-eth0. -- Les Mikesell lesmikes...@gmail.com ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Centos 6 - Persistant static routes
On 03/12/2015 03:51 PM, Les Mikesell wrote: On Thu, Mar 12, 2015 at 2:25 PM, Warren Young wrote: On Mar 12, 2015, at 11:52 AM, Jason Warr wrote: On Thu, 12 Mar 2015 12:43:27 -0500, Robert Moskowitz wrote: I found: http://www.cyberciti.biz/tips/configuring-static-routes-in-debian-or-red-hat-linux-systems.html where it says to add to ifcfg-eth0: 192.168.128.0/17 via 40.53.24.3 That’s only for RHEL 7: http://goo.gl/AtjIyI Aside from being irritating, that's just wrong. I'm using that syntax on Centos5, AH, I think I see what I did wrong. I put that line in the ifcfg-eth0 when according to this page, it goes in the route-eth0 just like the old format. I will give that a try tomorrow... ADDRESS0=192.168.128.0 NETMASK0=255.255.128.0 GATEWAY0=40.53.24.3 This is the scheme used in prior versions of RHEL. I think both types of syntax will work in all versions. The GUI tools do the latter form. ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Centos 6 - Persistant static routes
On Thu, Mar 12, 2015 at 2:25 PM, Warren Young wrote: > On Mar 12, 2015, at 11:52 AM, Jason Warr wrote: >> >> On Thu, 12 Mar 2015 12:43:27 -0500, Robert Moskowitz >> wrote: >> >>> I found: >>> >>> http://www.cyberciti.biz/tips/configuring-static-routes-in-debian-or-red-hat-linux-systems.html >>> >>> where it says to add to ifcfg-eth0: >>> >>> 192.168.128.0/17 via 40.53.24.3 > > That’s only for RHEL 7: http://goo.gl/AtjIyI Aside from being irritating, that's just wrong. I'm using that syntax on Centos5, >> ADDRESS0=192.168.128.0 >> NETMASK0=255.255.128.0 >> GATEWAY0=40.53.24.3 > > This is the scheme used in prior versions of RHEL. I think both types of syntax will work in all versions. The GUI tools do the latter form. -- Les Mikesell lesmikes...@gmail.com ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Centos 6 - Persistant static routes
On Thu, 12 Mar 2015 14:25:52 -0500, Warren Young wrote: ADDRESS0=192.168.128.0 NETMASK0=255.255.128.0 GATEWAY0=40.53.24.3 This is the scheme used in prior versions of RHEL. Are you saying this should not work in RHEL/Cent 7? It works fine for me in 5/6/7. ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Centos 6 - Persistant static routes
On Mar 12, 2015, at 11:52 AM, Jason Warr wrote: > > On Thu, 12 Mar 2015 12:43:27 -0500, Robert Moskowitz > wrote: > >> I found: >> >> http://www.cyberciti.biz/tips/configuring-static-routes-in-debian-or-red-hat-linux-systems.html >> >> where it says to add to ifcfg-eth0: >> >> 192.168.128.0/17 via 40.53.24.3 That’s only for RHEL 7: http://goo.gl/AtjIyI > ADDRESS0=192.168.128.0 > NETMASK0=255.255.128.0 > GATEWAY0=40.53.24.3 This is the scheme used in prior versions of RHEL. ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Centos 6 - Persistant static routes
On 03/12/2015 01:50 PM, Earl A Ramirez wrote: On 12 March 2015 at 13:43, Robert Moskowitz wrote: I know how to use 'ip' to set up a static route, e.g.: ip route add 192.168.128.0/17 via 40.53.24.3 dev eth0 But if you reboot or restart network, you loose this. Thus you have to make it persistant. I found: http://www.cyberciti.biz/tips/configuring-static-routes-in- debian-or-red-hat-linux-systems.html where it says to add to ifcfg-eth0: 192.168.128.0/17 via 40.53.24.3 But this did not work after the interface was restarted. So what is the proper to set up persistant static routes? ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos I have used this document [0] in the past and it worked for me, let me know if it works for you. [0] https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-networkscripts-static-routes-network-netmask-directives.html Yes it did. Brings back some really old memories of doing this way some 10 years ago. Back when I built a firewall on Centos4 with lots of ethernets and Shorewall and stuff. thanks ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Centos 6 - Persistant static routes
On Thu, 12 Mar 2015 12:43:27 -0500, Robert Moskowitz wrote: I know how to use 'ip' to set up a static route, e.g.: ip route add 192.168.128.0/17 via 40.53.24.3 dev eth0 But if you reboot or restart network, you loose this. Thus you have to make it persistant. I found: http://www.cyberciti.biz/tips/configuring-static-routes-in-debian-or-red-hat-linux-systems.html where it says to add to ifcfg-eth0: 192.168.128.0/17 via 40.53.24.3 Create the file /etc/sysconfig/network-scripts/route-eth0 Add the following for each static route, incrementing the numeric for each: ADDRESS0=192.168.128.0 NETMASK0=255.255.128.0 GATEWAY0=40.53.24.3 But this did not work after the interface was restarted. So what is the proper to set up persistant static routes? ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] Centos 6 - Persistant static routes
On 12 March 2015 at 13:43, Robert Moskowitz wrote: > I know how to use 'ip' to set up a static route, e.g.: > > ip route add 192.168.128.0/17 via 40.53.24.3 dev eth0 > > But if you reboot or restart network, you loose this. Thus you have to > make it persistant. I found: > > http://www.cyberciti.biz/tips/configuring-static-routes-in- > debian-or-red-hat-linux-systems.html > > where it says to add to ifcfg-eth0: > > 192.168.128.0/17 via 40.53.24.3 > > But this did not work after the interface was restarted. So what is the > proper to set up persistant static routes? > > > ___ > CentOS mailing list > CentOS@centos.org > http://lists.centos.org/mailman/listinfo/centos > I have used this document [0] in the past and it worked for me, let me know if it works for you. [0] https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Deployment_Guide/sec-networkscripts-static-routes-network-netmask-directives.html -- Kind Regards Earl Ramirez ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
[CentOS] Centos 6 - Persistant static routes
I know how to use 'ip' to set up a static route, e.g.: ip route add 192.168.128.0/17 via 40.53.24.3 dev eth0 But if you reboot or restart network, you loose this. Thus you have to make it persistant. I found: http://www.cyberciti.biz/tips/configuring-static-routes-in-debian-or-red-hat-linux-systems.html where it says to add to ifcfg-eth0: 192.168.128.0/17 via 40.53.24.3 But this did not work after the interface was restarted. So what is the proper to set up persistant static routes? ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos