Forums

Resolved
0 votes
Hi,

I just update my network from COS 6 and 5.2 to COS 7 Business. (App Version2.5.2)

In the old network for years I was use "static routes" just like say is in https://documentation.clearos.com/content:en_us:kb_bestpractices_managing_static_routes and static routes was working perfectly.

That configuration it's not working in COS 7, any one knows how can I do this in version 7?

Thank, regards.
Monday, January 27 2020, 06:29 PM
Share this post:
Responses (7)
  • Accepted Answer

    Wednesday, January 29 2020, 10:03 PM - #Permalink
    Resolved
    0 votes
    I don't know why you are getting an error. There is possibly something wrong in your config, perhaps the ifcfg-enp2s0f1 file but I don't know where. Have you chucked your logs?

    The other way of doing it is, if you don't have one, create a file /usr/sbin/ifup-local and make it executable and in it put something like:
    if [ "$1" == 'enp2s0f1' ]; then
    true
    # put some "route add" or "ip route add" command here
    fi
    You'll have to work out the rule to add. The ip command is preferable in some ways as route is deprecated, AFAIK. This file is executed any time an interface comes up
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, January 29 2020, 09:29 PM - #Permalink
    Resolved
    0 votes
    Nick Howitt wrote:

    And did the route get added? If not, can you try rebooting? There is another way of adding static routes, but I'd like to try to avoid it.



    No it's not added even with rebooting.


    [root@gateway ~]# route
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    default fixed-XXX-189-1 0.0.0.0 UG 0 0 0 enp2s0f0
    10.40.0.0 0.0.0.0 255.255.254.0 U 0 0 0 enp2s0f1
    172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
    172.18.0.0 0.0.0.0 255.255.0.0 U 0 0 0 br-b885a9038fbb
    XXX.189.18.128 0.0.0.0 255.255.255.192 U 0 0 0 enp2s0f0



    I trying in two different machines with same version of COS and results are the same. No route is added. :(
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, January 29 2020, 07:19 PM - #Permalink
    Resolved
    0 votes
    And did the route get added? If not, can you try rebooting? There is another way of adding static routes, but I'd like to try to avoid it.
    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, January 29 2020, 06:47 PM - #Permalink
    Resolved
    0 votes
    Nick Howitt wrote:

    I've tried this on a couple of machines and both work as expected. From your output, it looks like the route is not being added to the routing table. You should expect something like:
    10.10.3.0/21 via 10.40.0.11
    10.10.3.0 10.40.0.11 255.255.248.0 UG 0 0 0 enp2s0f1
    This route gets added when you do an:
    ifdown enp2s0f1 && ifup enp2s0f1
    Do you see any errors when you down and up the interface?


    [root@gateway ~]# ifdown enp2s0f1 && ifup enp2s0f1
    RTNETLINK answers: Invalid argumen

    (Installed in a HP Enterprise ProLiant MicroServer Gen10)


    [edit]
    Can you quickly check if you have iproute2 installed - "rpm -q iproute". I can't imigine you don't have it.
    [/edit]

    [root@gateway ~]# rpm -q iproute
    iproute-4.11.0-25.el7_7.2.x86_64


    The reply is currently minimized Show
  • Accepted Answer

    Wednesday, January 29 2020, 09:11 AM - #Permalink
    Resolved
    0 votes
    I've tried this on a couple of machines and both work as expected. From your output, it looks like the route is not being added to the routing table. You should expect something like:
    10.10.3.0/21 via 10.40.0.11
    10.10.3.0 10.40.0.11 255.255.248.0 UG 0 0 0 enp2s0f1
    This route gets added when you do an:
    ifdown enp2s0f1 && ifup enp2s0f1
    Do you see any errors when you down and up the interface?

    [edit]
    Can you quickly check if you have iproute2 installed - "rpm -q iproute". I can't imigine you don't have it.
    [/edit]
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, January 28 2020, 06:10 PM - #Permalink
    Resolved
    0 votes
    Hi Nick
    Yes I do, and still not working, perhaps I doing something wrong for this new version. :(


    I trying this:
    I have 2 networks connected with fiber and I need they're have communicartion between them 10.40.0.0/23 and 10.10.3.0/21, each with they're own DHCP server running, to connect between them I use another COS with 2 nic configurated as LAN (1) 10.40.0.11 and (2) 10.10.3.11 to avoid dhcp problems.


    Interfaz Papel Tipo Dirección IP Action
    enp2s0f1 LAN Estático 10.40.0.1
    enp2s0f0 Externo Estático XX.188.155.39


    "/etc/sysconfig/network-scripts/route-enp2s0f1"
    10.10.3.0/21 via 10.40.0.11

    "/etc/clearos/network.conf"
    # Network mode
    MODE="gateway"

    # Network interface roles
    EXTIF="enp2s0f0"
    LANIF="enp2s0f1"
    DMZIF=""
    HOTIF=""

    # Domain and Internet Hostname
    DEFAULT_DOMAIN="gateway.12"
    INTERNET_HOSTNAME="gateway.12"

    # Extra LANS
    EXTRALANS="10.10.3.0/21"


    [root@gateway ~]# route
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    default gateway 0.0.0.0 UG 0 0 0 enp2s0f0
    10.40.0.0 0.0.0.0 255.255.254.0 U 0 0 0 enp2s0f1
    172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
    172.18.0.0 0.0.0.0 255.255.0.0 U 0 0 0 br-ead223dfff79
    XX.188.155.39 0.0.0.0 255.255.255.224 U 0 0 0 enp2s0f0



    [root@gateway ~]# traceroute 10.40.0.11
    traceroute to 10.40.0.11 (10.40.0.11), 30 hops max, 60 byte packets
    1 10.40.0.11 (10.40.0.11) 0.956 ms 0.838 ms 0.801 ms


    [root@gateway ~]# traceroute 10.10.3.11
    traceroute to 10.10.3.11 (10.10.3.11), 30 hops max, 60 byte packets
    1 gateway.12 (XX.188.155.39) 357.046 ms !H 356.954 ms !H 356.909 ms !H



    regards!
    The reply is currently minimized Show
  • Accepted Answer

    Monday, January 27 2020, 08:39 PM - #Permalink
    Resolved
    0 votes
    As far as I know it is still working. Are you adjusting your route-eth1 file name and the ifum/down commands to match your new interface name?
    The reply is currently minimized Show
Your Reply