Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Gentoo routing - multiple NICs
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cezar.serban
n00b
n00b


Joined: 08 Aug 2013
Posts: 11

PostPosted: Thu Aug 08, 2013 3:55 pm    Post subject: [SOLVED] Gentoo routing - multiple NICs Reply with quote

Hello.

I work for a small telecom company which uses Gentoo for our routers.

I will attempt to describe my setup. The router has 2 NICs, one is used for LAN traffic, the other is the uplink with our ISP.

The LAN has 4 /28 subnets, and the various hosts use the router's interface as the default GW.

The WAN has a /30 subnet, one IP for the router and the other one for the ISP and is setup as the default route.

Below is the config. It's fairly simple (I had to change the IP addresses for security reasons).

Code:
config_eth0=(
        "10.10.10.130/30"
)
config_eth1=(
        "1.1.1.137/28"
        "2.2.2.129/28"
        "3.3.3.101/28"
        "4.4.4.17/28"
)

routes_eth0=(
        "default via 10.10.10.129"            # IPv4 default route

)


Right now I have an HP 360 server with an older version which is setup with this config and packets are being forwarded correctly.

However, I have installed a new snapshot of Gentoo on a Dell 1950 server and using the exact same configuration, the LAN hosts cannot reach the router. However, I do have Layer 3 connectivity on both NICs.

How should I configure the /etc/conf.d/net file in order to have correct routing?

I tried the following config, since I read that now you have to also include the subnets in the route statement as an array.
Code:

        routes_enp5s0=(
           "1.1.1.128/28  gw 1.1.1.137"
           "2.2.2.128/28 gw 2.2.2.2.129"
           "3.3.3.96/28 gw 3.3.3.101
           "4.4.4.16/28 gw 4.4.4.17
       "default via 10.10.10.129"
        )   

I hope I made my case clear. If not,I can try to explain in a different way.

Note: enp5s0 is eth0, renamed due to udev changes.

Thank you for your time.


Last edited by cezar.serban on Tue Aug 13, 2013 10:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1248
Location: 42.68n 85.41w

PostPosted: Thu Aug 08, 2013 4:07 pm    Post subject: Reply with quote

i put requested articles in for brid, and quagga... see if the original router has these.
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1733
Location: St. Wendel

PostPosted: Thu Aug 08, 2013 4:45 pm    Post subject: Reply with quote

Did you enable forwarding?

Code:
cat /proc/sys/net/ipv4/ip_forward
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42592
Location: 56N 3W

PostPosted: Thu Aug 08, 2013 5:52 pm    Post subject: Reply with quote

cezar.serban,

Welcome to Gentoo.

The syntax you are using is for baselayout1 but that has been obsolete for 2 years or so now.

My system has
Code:
config_eth0="5.135.178.112/24 brd 5.135.178.255
             2001:41d0:8:b970::2/56"

routes_eth0="default via 5.135.178.254
             default via 2001:41d0:8:b9ff:ff:ff:ff:fd"


This makes your
Code:
routes_enp5s0=(
           "1.1.1.128/28  gw 1.1.1.137"
           "2.2.2.128/28 gw 2.2.2.2.129"
           "3.3.3.96/28 gw 3.3.3.101
           "4.4.4.16/28 gw 4.4.4.17
       "default via 10.10.10.129"
        )   
incorrect in several counts. use via not gw, remove the () and fix the double quotes.
I trust the the quotes are missing only in your post and not in your net file?

Paste the output of route if fixing your net file and restarting net.enp5s0 fails.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
cezar.serban
n00b
n00b


Joined: 08 Aug 2013
Posts: 11

PostPosted: Thu Aug 08, 2013 5:53 pm    Post subject: Reply with quote

Sorry,I am not aware of what "brid" means. I assume it refers to bridging but this was not the case with the original router. Quagga was not used, just a static route via the ISP's IP address.

Yes, IP forwarding is enabled.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42592
Location: 56N 3W

PostPosted: Thu Aug 08, 2013 6:06 pm    Post subject: Reply with quote

cezar.serban,

It looks like our posts crossed in flight. See above ^^^
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
cezar.serban
n00b
n00b


Joined: 08 Aug 2013
Posts: 11

PostPosted: Thu Aug 08, 2013 6:09 pm    Post subject: Reply with quote

NeddySeagoon wrote:
cezar.serban,

Welcome to Gentoo.

The syntax you are using is for baselayout1 but that has been obsolete for 2 years or so now.

My system has
Code:
config_eth0="5.135.178.112/24 brd 5.135.178.255
             2001:41d0:8:b970::2/56"

routes_eth0="default via 5.135.178.254
             default via 2001:41d0:8:b9ff:ff:ff:ff:fd"


This makes your
Code:
routes_enp5s0=(
           "1.1.1.128/28  gw 1.1.1.137"
           "2.2.2.128/28 gw 2.2.2.2.129"
           "3.3.3.96/28 gw 3.3.3.101
           "4.4.4.16/28 gw 4.4.4.17
       "default via 10.10.10.129"
        )   
incorrect in several counts. use via not gw, remove the () and fix the double quotes.
I trust the the quotes are missing only in your post and not in your net file?

Paste the output of route if fixing your net file and restarting net.enp5s0 fails.


Thank you for your quick reply.

Just to clarify, placing the subnets in route_enp5s0 is correct? They are configured on the LAN interface.

The quotes are missing only in the post.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42592
Location: 56N 3W

PostPosted: Thu Aug 08, 2013 6:48 pm    Post subject: Reply with quote

cezar.serban,

I have the subnets in the config_ statement. There they generate the correct gateway free routes for all the hosts in the subnet.
There is a well commented example net file at /usr/share/doc/openrc-0.11.8/net.example.bz2 that explains how to set up the net file.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
cezar.serban
n00b
n00b


Joined: 08 Aug 2013
Posts: 11

PostPosted: Thu Aug 08, 2013 7:23 pm    Post subject: Reply with quote

NeddySeagoon wrote:
cezar.serban,

I have the subnets in the config_ statement. There they generate the correct gateway free routes for all the hosts in the subnet.
There is a well commented example net file at /usr/share/doc/openrc-0.11.8/net.example.bz2 that explains how to set up the net file.


I read the configuration file before but it did not really help me understand how to configure the interfaces.

The reason why I keep asking is because this router has to be set up during a maintenance work in order to avoid disrupting services.

In theory, should the following config allow for LAN traffic to pass via my WAN one? enp5s0 is WAN, enp9s0 is LAN.

Quote:
config_en5s0="10.10.10.130/30 brd 10.10.10.131"

config_enp9s0="1.1.1.137/28 brd ...
2.2.2.129/28 brd ...
3.3.3.101/28 brd ...
4.4.4.17/28 brd..."


routes_enp5s0="default via 10.10.10.129"



Please let me know if this is correct or not, I seem to be having some trouble grasping a few basic concepts.
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1248
Location: 42.68n 85.41w

PostPosted: Thu Aug 08, 2013 7:30 pm    Post subject: Reply with quote

net-misc/bird

A routing daemon implementing OSPF, RIPv2 & BGP for IPv4 or IPv6

net-misc/quagga

A free routing daemon replacing Zebra supporting RIP, OSPF and BGP

id like to get a fierce routing wiki going, but unfortunately do not have the skils. i can get to the point of pointing at and installing the packages. i like static routes, so id be interested in the solution you get also.
Back to top
View user's profile Send private message
cezar.serban
n00b
n00b


Joined: 08 Aug 2013
Posts: 11

PostPosted: Thu Aug 08, 2013 8:57 pm    Post subject: Reply with quote

666threesixes666 wrote:
net-misc/bird

A routing daemon implementing OSPF, RIPv2 & BGP for IPv4 or IPv6

net-misc/quagga

A free routing daemon replacing Zebra supporting RIP, OSPF and BGP

id like to get a fierce routing wiki going, but unfortunately do not have the skils. i can get to the point of pointing at and installing the packages. i like static routes, so id be interested in the solution you get also.


We do use quagga but on other routers. My company also has some /24 subnets which need to be advertised via BGP but in this case I just need static routing.
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1248
Location: 42.68n 85.41w

PostPosted: Thu Aug 08, 2013 9:18 pm    Post subject: Reply with quote

i found a tutorial online of static routing via quagga.... http://openmaniak.com/quagga_case1.php i dont know the date or accuracy to it. it seems as if this would be a good solution for your case as your office already runs quagga on other machines.

oh snap, looks like its already been done.... https://wiki.gentoo.org/wiki/Static_Routing
Back to top
View user's profile Send private message
cezar.serban
n00b
n00b


Joined: 08 Aug 2013
Posts: 11

PostPosted: Fri Aug 09, 2013 12:23 pm    Post subject: Reply with quote

I believe some confusion has been created as as results of the many replies posted in this thread.

I do not want/need to use Quagga for this router because all I need is a static route. I do not need a routing protocol which would only cause overhead when I only have a few internal networks which have 1 exit interface.

Could it be a problem with the kernel itself when routing?
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1733
Location: St. Wendel

PostPosted: Fri Aug 09, 2013 12:26 pm    Post subject: Reply with quote

I ask again, did you enable Forwarding?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42592
Location: 56N 3W

PostPosted: Fri Aug 09, 2013 8:59 pm    Post subject: Reply with quote

cezar.serban,

Post your net file as it is now.
Post the output of the route command, so we can see the routing table your net file generates.

Do not copy type. Use wgetpaste if you prefer. You will need to emerge it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
cezar.serban
n00b
n00b


Joined: 08 Aug 2013
Posts: 11

PostPosted: Tue Aug 13, 2013 10:55 pm    Post subject: Reply with quote

Hello again.

It seems the problem was with the vlans on our Switch. The configuration was correct after all.

I have marked the thread as solved. Thank you again for all your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum