Re: [CentOS] Gateway question

2016-08-11 Thread Levente Birta
On 10/08/2016 16:54, Anthony K wrote: On 10/08/16 16:29, Levente Birta wrote: And as I said this problem is resolved too ... I asked for another way to achieve this When you add a default gateway with: route add default gw 192.168.1.1 dev enp3s0 you'll note that you now have 2 routes with the

Re: [CentOS] Gateway question

2016-08-10 Thread Anthony K
On 10/08/16 16:29, Levente Birta wrote: And as I said this problem is resolved too ... I asked for another way to achieve this When you add a default gateway with: route add default gw 192.168.1.1 dev enp3s0 you'll note that you now have 2 routes with the same metric of 0 (use route -n to see

Re: [CentOS] Gateway question

2016-08-10 Thread Levente Birta
On 10/08/2016 15:28, Jonathan Billings wrote: On Wed, Aug 10, 2016 at 09:29:15AM +0300, Levente Birta wrote: I read the document again ... and this talk about accessing this multi-homed host from the internet... I have all this configured and working! You say this is working because of the out

Re: [CentOS] Gateway question

2016-08-10 Thread Jonathan Billings
On Wed, Aug 10, 2016 at 09:29:15AM +0300, Levente Birta wrote: > I read the document again ... and this talk about accessing this multi-homed > host from the internet... > I have all this configured and working! You say this is working because of the output here? # ip route show

Re: [CentOS] Gateway question

2016-08-09 Thread Levente Birta
On 09/08/2016 23:11, Gordon Messmer wrote: On 08/09/2016 12:03 PM, John R Pierce wrote: those are both the same network, and the default gateway is a global thing. packets forwarded to 192.168.1.1 could use either 192.168.1.12 or .13, as they are all the same. in reality, they will use the fir

Re: [CentOS] Gateway question

2016-08-09 Thread Levente Birta
On 09/08/2016 23:08, Gordon Messmer wrote: On 08/09/2016 11:51 AM, Birta Levente wrote: If I add "#route add default gw 192.168.1.1 dev enp3s0" all is good, but cannot add that in route-iface file or with "ip route" Are you using the "network" or the "NetworkManager" service to configure

Re: [CentOS] Gateway question

2016-08-09 Thread Levente Birta
On 09/08/2016 22:16, John R Pierce wrote: On 8/9/2016 11:51 AM, Birta Levente wrote: I do all this and working on LAN ... all traffic go in/out on the proper interface ... the problem is when I try to access the internet on the second interface how do you try and access the 'internet on

Re: [CentOS] Gateway question

2016-08-09 Thread Gordon Messmer
On 08/09/2016 12:03 PM, John R Pierce wrote: those are both the same network, and the default gateway is a global thing. packets forwarded to 192.168.1.1 could use either 192.168.1.12 or .13, as they are all the same. in reality, they will use the first match they find. Generally, but not

Re: [CentOS] Gateway question

2016-08-09 Thread Gordon Messmer
On 08/09/2016 11:51 AM, Birta Levente wrote: If I add "#route add default gw 192.168.1.1 dev enp3s0" all is good, but cannot add that in route-iface file or with "ip route" Are you using the "network" or the "NetworkManager" service to configure your network? I haven't verified that th

Re: [CentOS] Gateway question

2016-08-09 Thread John R Pierce
On 8/9/2016 11:51 AM, Birta Levente wrote: I do all this and working on LAN ... all traffic go in/out on the proper interface ... the problem is when I try to access the internet on the second interface how do you try and access the 'internet on the second interface' when its all the

Re: [CentOS] Gateway question

2016-08-09 Thread John R Pierce
On 8/9/2016 11:42 AM, Birta Levente wrote: So, again: Centos 7 2 NICs enp2s0-192.168.1.12 enp3s0-192.168.1.13 default gateway on enp2s0 is 192.168.1.1, defined in /etc/sysconfig/network Which other way (preferred with "ip route") can I add this, but: #route add default gw 192.168.1.1 dev enp3s

Re: [CentOS] Gateway question

2016-08-09 Thread Birta Levente
On 09/08/2016 20:01, Gordon Messmer wrote: On 08/08/2016 04:05 AM, Levente Birta wrote: Can I add this in any config files (ex: route-enp2s0)? Yes. Add a route file for each interface, and set up rules to send packets out the corresponding physical interface: https://blogs.oracle.com/ne

Re: [CentOS] Gateway question

2016-08-09 Thread Birta Levente
On 09/08/2016 15:47, Jonathan Billings wrote: On Tue, Aug 09, 2016 at 10:58:40AM +0300, Levente Birta wrote: What I don't understand why the route command allow to add a second default gateway with different interface, but the ip route command doesn't? You can only have one default gateway.

Re: [CentOS] Gateway question

2016-08-09 Thread Gordon Messmer
On 08/08/2016 04:05 AM, Levente Birta wrote: Can I add this in any config files (ex: route-enp2s0)? Yes. Add a route file for each interface, and set up rules to send packets out the corresponding physical interface: https://blogs.oracle.com/networking/entry/advance_routing_for_multi_homed

Re: [CentOS] Gateway question

2016-08-09 Thread Jonathan Billings
On Tue, Aug 09, 2016 at 10:58:40AM +0300, Levente Birta wrote: > What I don't understand why the route command allow to add a second default > gateway with different interface, but the ip route command doesn't? You can only have one default gateway. It sounds to me like you want to use both inter

Re: [CentOS] Gateway question

2016-08-09 Thread Levente Birta
On 09/08/2016 06:56, Anthony K wrote: On 08/08/16 21:05, Levente Birta wrote: But how can I add achieve this only with ip route command ... without route? Can I add this in any config files (ex: route-enp2s0)? Hi Levente. The iproute2 man page for each command is rather well documented on Ce

Re: [CentOS] Gateway question

2016-08-08 Thread Anthony K
On 08/08/16 21:05, Levente Birta wrote: But how can I add achieve this only with ip route command ... without route? Can I add this in any config files (ex: route-enp2s0)? Hi Levente. The iproute2 man page for each command is rather well documented on CentOS 7. For instance, to view the s

Re: [CentOS] Gateway question

2016-08-08 Thread Levente Birta
On 08/08/2016 14:22, Ashish Yadav wrote: Hi, You can define your default gateway in "/etc/sysconfig/network" file, GATEWAY="192.168.1.1" After that, restart network services. # systemctl restart network It's defined and it is in routing table ... the only thing added is: #route add d

Re: [CentOS] Gateway question

2016-08-08 Thread Ashish Yadav
Hi, You can define your default gateway in "/etc/sysconfig/network" file, GATEWAY="192.168.1.1" After that, restart network services. # systemctl restart network --Regards Ashishkumar S. Yadav On Mon, Aug 8, 2016 at 4:35 PM, Levente Birta wrote: > Hi > > There is a Centos 7 up-to-date box

[CentOS] Gateway question

2016-08-08 Thread Levente Birta
Hi There is a Centos 7 up-to-date box with 2 interfaces, let's say 192.168.1.12 - enp2s0, 192.168.1.13 on enp3s0. Default gateway on enp2s0. The gateway is pfsense, IP is 192.168.1.1 with 2 WAN connections On the gateway the outgoing traffic is routed by source ip to different WAN, 192.168.1