You are not logged in.

#1 2011-06-22 12:52:51

agkbill
Member
Registered: 2011-06-13
Posts: 85

Routing ppp togheter with NFS, did I get it all right?

Hi,

I am new to archlinux and network routing so I was just woundering if someone could take a look and se if I made this correct.

Setup:

I have a small server, I want all traffic (except the one going through NFS to another computer on my local network) to go  through my VPN tunnel.

For VPN I followed the guide "Microsoft VPN client setup with pptpclient" at https://wiki.archlinux.org/index.php/Mi … pptpclient. Works great!
For NFS I followed the guide "NFS" at https://wiki.archlinux.org/index.php/NFS.

I have not automated anything yet, wanted to make sure it works at is should first.


Well, this is what it looks like:

When I start up my server.

[root@arch ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:0c:6e:4a:e1:fb brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.139/24 brd 192.168.1.255 scope global eth0
    inet6 fe80::20c:6eff:fe4a:e1fb/64 scope link 
       valid_lft forever preferred_lft forever
[root@arch ~]#
[root@arch ~]# ip route
default via 192.168.1.1 dev eth0  metric 202 
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.139  metric 202 
[root@arch ~]#

Then I start my VPN tunnel with "/etc/rc.d/ipredator start"

[root@arch ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:0c:6e:4a:e1:fb brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.139/24 brd 192.168.1.255 scope global eth0
    inet6 fe80::20c:6eff:fe4a:e1fb/64 scope link 
       valid_lft forever preferred_lft forever
3: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1496 qdisc pfifo_fast state UNKNOWN qlen 3
    link/ppp 
    inet 93.182.130.114 peer 93.182.130.2/32 scope global ppp0
[root@arch ~]#

[root@arch ~]# ip route
default via 192.168.1.1 dev eth0  metric 202 
93.182.130.2 via 192.168.1.1 dev eth0  src 192.168.1.139 
93.182.130.2 dev ppp0  proto kernel  scope link  src 93.182.130.114 
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.139  metric 202 
[root@arch ~]#

Now I want to route everything through VPN(ppp0) and open for NFS to 192.168.1.135.

[root@arch ~]# ip route add default dev ppp0
[root@arch ~]# ip route add 192.168.1.135 dev eth0
[root@arch ~]# ip route
default dev ppp0  scope link 
default via 192.168.1.1 dev eth0  metric 202 
93.182.130.2 via 192.168.1.1 dev eth0  src 192.168.1.139 
93.182.130.2 dev ppp0  proto kernel  scope link  src 93.182.130.114 
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.139  metric 202 
192.168.1.135 dev eth0  scope link 
[root@arch ~]# 

Now I believe everything except traffic to 192.168.1.136 is going through my VPN.

NFSv4 is also forking great, speed up to 10MiB/s

I feel quite happy with archlinux, tried to do this with outer distros but no luck.


Feedback and comments most welcome.

Best regards,
/Christer

Offline

#2 2011-06-22 23:21:01

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Routing ppp togheter with NFS, did I get it all right?

[root@arch ~]# ip route add 192.168.1.135 dev eth0

You don't need to do that. It will already be matched by the existing /24 route.

[root@arch ~]# ip route
default dev ppp0  scope link 
default via 192.168.1.1 dev eth0  metric 202 
93.182.130.2 via 192.168.1.1 dev eth0  src 192.168.1.139 
93.182.130.2 dev ppp0  proto kernel  scope link  src 93.182.130.114 
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.139  metric 202 
192.168.1.135 dev eth0  scope link 
[root@arch ~]# 

Correct, everything EXCEPT traffic for:
1) 93.182.130.2
2) 192.168.1.0/24
is routed via your ppp tunnel.

Offline

#3 2011-06-24 13:25:30

agkbill
Member
Registered: 2011-06-13
Posts: 85

Re: Routing ppp togheter with NFS, did I get it all right?

Thank you fukawi2!

But is really 192.168.1.0/24 routed via my ppp tunnel?

I thout it was

192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.139  metric 202

that made it possible for NFS to connect directly to my 192.168.1.135 computer.

Now I have included,

ip route add default dev ppp0

in my VPN daemon script (https://wiki.archlinux.org/index.php/Mi … pptpclient)

After starting the VPN tunnel it now looks like this.

[root@arch ~]# ip route
default dev ppp0  scope link 
default via 192.168.1.1 dev eth0  metric 202 
93.182.130.2 via 192.168.1.1 dev eth0  src 192.168.1.139 
93.182.130.2 dev ppp0  proto kernel  scope link  src 93.182.130.103 
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.139  metric 202 
[root@arch ~]#[root@arch ~]# 
[root@arch ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
    link/ether 00:0c:6e:4a:e1:fb brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.139/24 brd 192.168.1.255 scope global eth0
    inet6 fe80::20c:6eff:fe4a:e1fb/64 scope link 
       valid_lft forever preferred_lft forever
3: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1496 qdisc pfifo_fast state UNKNOWN qlen 3
    link/ppp 
    inet 93.182.130.103 peer 93.182.130.2/32 scope global ppp0
[root@arch ~]# 

Thank you,

/Christer

Offline

#4 2011-06-25 00:25:06

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,237
Website

Re: Routing ppp togheter with NFS, did I get it all right?

agkbill wrote:

But is really 192.168.1.0/24 routed via my ppp tunnel?

No, I said everything *EXCEPT*. That is your local network, you can't send it down the PPP tunnel.

agkbill wrote:

I thout it was

192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.139  metric 202

that made it possible for NFS to connect directly to my 192.168.1.135 computer.

You're confusing things here. NFS is a protocol; it is at a different OSI Layer than routing. Routing's job is to get the traffic to the destination, regardless of protocol.

Offline

#5 2011-06-26 20:51:44

agkbill
Member
Registered: 2011-06-13
Posts: 85

Re: Routing ppp togheter with NFS, did I get it all right?

OK, thank you.

Do you have any suggestion on were routing in linux is explained in a easy newbie friendly way?

Great, then it feels like I got it all up and running.

But just the outer day I discovered that the routing changed for some reason, the server has just been running.
The VPN tunnel, rtorrent, screen, tmux and htop that is it.

When I started.

[christer@arch ~]$ ip route                                                                                
default dev ppp0  scope link                                                                                        
default via 192.168.1.1 dev eth0  metric 202                                                                                
93.182.180.2 via 192.168.1.1 dev eth0  src 192.168.1.139                                                                                 
93.182.181.2 via 192.168.1.1 dev eth0  src 192.168.1.139                                                                                  
93.182.181.2 dev ppp0  proto kernel  scope link  src 93.182.181.134.134
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.139  metric 202 
[christer@arch ~]$

But then the day after.

[christer@arch ~]$ ip route      
default via 192.168.1.1 dev eth0  metric 202    
93.182.153.2 via 192.168.1.1 dev eth0  src 192.168.1.139                          
93.182.153.2 dev ppp0  proto kernel  scope link  src 93.182.153.68 
93.182.180.2 via 192.168.1.1 dev eth0  src 192.168.1.139   
93.182.181.2 via 192.168.1.1 dev eth0  src 192.168.1.139 
192.168.1.0/24 dev eth0  proto kernel  scope link  src 192.168.1.139  metric 202
[christer@arch ~]$

I suspect that it can have been due to new ip for the VPN. I did not have 93.182.153.2 when I started.

Any idea what can happen?

Any way to keep "default dev ppp0  scope link"

Thank you,

Regards,
/Christer

Offline

Board footer

Powered by FluxBB