[LARTC] IP tunneling

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I have a problem with GRE tunneling. I read  Advanced-Routing HOWTO
about this and I did all as is written in this documentation. Even the
same example is here which I need for my project.
I want create (by means of GRE tunneling or IP in IP tunneling) virtual
private network VPN - in first phase without IPsec in other phase with
IPsec.
I have two local networks distant apart with two routers. Both routers
have registered IP addresses (I have only two registered IP addresses and many
computers in local netwoks which I connected to Internet); first router connects
one local network to Internet and second router connects other local network
to Internet. Computers in both networks have the access to Internet over
routers because I configured IP-Masquerade. Now I want solve the access of
computer from my first local network to computers from my second local network.
 
So I have network
A:
      network 192.168.1.0
      netmask 255.255.255.0
      router  192.168.1.1 (eth1)
    
router is connected to Internet over eth0 - 145.35.162.44 netmask is /21
 
and network
B:
      network 192.168.2.0
      netmask 255.255.255.0
      router  192.168.2.1 (eth1)
    
router is connected to Internet over eth0 - 145.35.160.94 netmask is /21           
 
I wrote this two scripts (I use RedHat 6.1 on both routers with kernel 2.2.12)
 
file rc.ipip on router A
 
#!/bin/sh
PATH=/sbin:/usr/sbin
echo installing modul...
modprobe ip_gre
echo setting tunl0...
ip tunnel add neta mode gre remote 145.35.160.94 local 145.35.162.44 ttl 255
echo adding network ariel2...
ip addr add 192.168.1.1 dev neta
ip route add 192.168.2.0/24 dev neta
 
in file rc.local
.
.
.
/etc/rc.d/rc.ipip
 
file rc.ipip on router B
 
#!/bin/sh
PATH=/sbin:/usr/sbin
echo installing modul...
modprobe ip_gre
echo setting tunl0...
ip tunnel add netb mode gre remote 145.35.162.44 local 145.35.160.94 ttl 255
echo adding nework ariel...
ip addr add 192.168.2.1 dev netb
ip route add 192.168.1.0/24 dev netb
 
in file rc.local
.
.
.
/etc/rc.d/rc.ipip
 
...it's so easy...but
When I start these scripts the error come:
RTNETLINK answers: Networking is out of work
Where did I make mistake?
 
---------------------------------------------
And second thing...
When I tried to take in work IP in IP tunneling I didn't know where to find
modul new_tunnel because this modul is'n in my distribution of RedHat. I haven't
problem with modul ipip.
 
I would be very happy if somebody could help me.
thanks,
     Vilem Musil
 
....sorry for my english

[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux