Skip to contentSkip to conversation

GRE tunnel problems

LARTC Michael Tedesco 2 participants 3 messages Feb 13, 2005 – Feb 14, 2005

lore
Share & tools
lore
#0 lore raw

Hello,

Here is my network:

            ------------------                             -------------

----------- Linux box ----------- GRE --------- Cisco ----------

            ------------------                             -------------

What I wan to accomplish. I want ripv2 to go across (both ways) through the GRE tunnel.

No packets are being passed thought the GRE tunnel0. So first I have to fix my GRE tunnel. Well it seems that way anyways. I also have two questions at the below in bold. If you need anymore info please ask.

I am using quagga and ripd daemons also.

Quagga version - quagga-0.96.4-1.1

Kernal version - Linux 2.6.10

Mike

This is how I configure my GRE tunnel:

[root@TestLinux root]# modprobe ip_gre

[root@TestLinux root]# ip tunnel add tunnel0 mode gre remote 20.0.0.250 local 20.0.0.249

[root@TestLinux root]# ip link set tunnel0 up

[root@TestLinux root]# ip addr add 192.168.2.4/24 dev tunnel0

[root@TestLinux root]# ip route add 192.168.2.0/24 dev tunnel0

RTNETLINK answers: File exists

[root@TestLinux root]# ip link set dev tunnel0 multicast on

1) I do not know what 'RTNETLINK answers: File exists' mean beside maybe that the route was automatically created.? I created the route though the tunnel before and this message never came up before.

[root@TestLinux root]# ip addr ls

1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc htb qlen 1000

    link/ether 00:02:a5:df:01:d9 brd ff:ff:ff:ff:ff:ff

    inet 20.0.0.249/24 brd 20.0.0.255 scope global eth0

3: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc htb qlen 1000

    link/ether 00:0d:88:2d:94:80 brd ff:ff:ff:ff:ff:ff

    inet 10.0.50.1/24 brd 10.0.50.255 scope global eth1

4: gre0: <NOARP> mtu 1476 qdisc noop

    link/gre 0.0.0.0 brd 0.0.0.0

5: tunnel0@NONE: <POINTOPOINT,MULTICAST,NOARP,UP> mtu 1476 qdisc noqueue

    link/gre 20.0.0.249 peer 20.0.0.250

    inet 192.168.2.4/24 scope global tunnel0

2) Where did 'gre0' come from? This leads me to belive all of my traffic are going thought this interface.

zebra-TestLinux# show interface

Interface eth0 is up, line protocol detection is disabled

index 2 metric 1 mtu 1500 <UP,BROADCAST,RUNNING,MULTICAST>

HWaddr: 00:02:a5:df:01:d9

inet 20.0.0.249/24 broadcast 20.0.0.255

input packets 13724, bytes 872184, dropped 0, multicast packets 0

input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

output packets 19637, bytes 2395991, dropped 0

output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

collisions 41

Interface eth1 is up, line protocol detection is disabled

index 3 metric 1 mtu 1500 <UP,BROADCAST,MULTICAST>

HWaddr: 00:0d:88:2d:94:80

inet 10.0.50.1/24 broadcast 10.0.50.255

input packets 0, bytes 0, dropped 0, multicast packets 0

input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

output packets 13, bytes 828, dropped 0

output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

collisions 0

Interface gre0 is down

index 4 metric 1 mtu 1476 <NOARP>

input packets 0, bytes 0, dropped 0, multicast packets 0

input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

output packets 0, bytes 0, dropped 0

output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

collisions 0

Interface lo is up, line protocol detection is disabled

index 1 metric 1 mtu 16436 <UP,LOOPBACK,RUNNING>

inet 127.0.0.1/8

input packets 2098, bytes 2234827, dropped 0, multicast packets 0

input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

output packets 2098, bytes 2234827, dropped 0

output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

collisions 0

Interface tunnel0 is up, line protocol detection is disabled

index 5 metric 1 mtu 1476 <UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>

inet 192.168.2.4/24 pointopoint 192.168.2.4

input packets 0, bytes 0, dropped 0, multicast packets 0

input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

output packets 0, bytes 0, dropped 0

output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

collisions 0

rip-TestLinix# show ip rip

Codes: R - RIP, C - connected, S - Static, O - OSPF, B - BGP

Sub-codes:

(n) - normal, (s) - static, (d) - default, (r) - redistribute,

(i) - interface

Network Next Hop Metric From Tag Time

C(i) 10.0.50.0/24 0.0.0.0 1 self 0

C(i) 192.168.2.0/24 0.0.0.0 1 self 0

rip-TestLinix# show ip rip status

Routing Protocol is "rip"

Sending updates every 30 seconds with +/-50%, next due in 6 seconds

Timeout after 180 seconds, garbage collect after 120 seconds

Outgoing update filter list for all interface is not set

Incoming update filter list for all interface is not set

Default redistribution metric is 1

Redistributing:

Default version control: send version 2, receive version 2

Interface Send Recv Key-chain

eth1 2 2

tunnel0 2 2

Routing for Networks:

    10.0.50.0/24

    192.168.2.0/24

Routing Information Sources:

Gateway BadPackets BadRoutes Distance Last Update

Distance: (default is 120)

[root@TestLinux root]# ip -s link ls tunnel0

5: tunnel0@NONE: <POINTOPOINT,MULTICAST,NOARP,UP> mtu 1476 qdisc noqueue

link/gre 20.0.0.249 peer 20.0.0.250

RX: bytes packets errors dropped overrun mcast

672 8 0 0 0 0

TX: bytes packets errors dropped carrier collsns

864 8 0 0 0 0

#1 lore raw

Hi Michael,
To answer your two questions first,
1) about the rtnetlink error when trying to add the route : in my experience, when creating the gre tunnel, it automatically creates the route for you when you set the link to 'up' and add an address to the device.
you need to make sure you put the /xx netmask after the address though, so it knows what route to create. if you dont put anything after it, it will assume a /32, and you wont get any auto-created routes. (probably not what you want).
either way, you can check your existing routes with the 'ip route' command

2) I'm assuming the gre device is created when you modprobe gre. I have gre built in to my kernel, so the device always exists for me.

as for why it's not working, it might have something to do with your IP's conflicting.

from the output you gave, it looks like linux/eth0 has the IP 20.0.0.249, as does the cisco/eth0.
same goes for the tunnel. both devices have the 192.168.2.4 IP.

if you want everything to work right, the linux and cisco devices will need independent IP's.

to change the IP on the linux, you can do this :
#ip address del 20.0.0.249/24 dev eth0
#ip address add 20.0.0.250/24 dev eth0
#ip address del 192.168.2.4/24 dev tunnel0
(assuming 192.168.2.5 isnt taken)
#ip address add 192.168.2.5/24 dev tunnel0
and of course, your tunnel remote and local will have to be swapped use the following command when you create your tunnel. [root@TestLinux root]# ip tunnel add tunnel0 mode gre remote 20.0.0.249 local 20.0.0.250

Good Luck
-Joe

Quoted 260 lines · Michael Tedesco

Hello,

Here is my network:

            ------------------                             -------------

----------- Linux box ----------- GRE --------- Cisco ----------

            ------------------                             -------------

What I wan to accomplish. I want ripv2 to go across (both ways) through the GRE tunnel.

No packets are being passed thought the GRE tunnel0. So first I have to fix my GRE tunnel. Well it seems that way anyways. I also have two questions at the below in bold. If you need anymore info please ask.

I am using quagga and ripd daemons also.

Quagga version - quagga-0.96.4-1.1

Kernal version - Linux 2.6.10

Mike

This is how I configure my GRE tunnel:

[root@TestLinux root]# modprobe ip_gre

[root@TestLinux root]# ip tunnel add tunnel0 mode gre remote 20.0.0.250 local 20.0.0.249

[root@TestLinux root]# ip link set tunnel0 up

[root@TestLinux root]# ip addr add 192.168.2.4/24 dev tunnel0

[root@TestLinux root]# ip route add 192.168.2.0/24 dev tunnel0

RTNETLINK answers: File exists

[root@TestLinux root]# ip link set dev tunnel0 multicast on

1) I do not know what 'RTNETLINK answers: File exists' mean beside maybe that the route was automatically created.? I created the route though the tunnel before and this message never came up before.

[root@TestLinux root]# ip addr ls

1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc htb qlen 1000

    link/ether 00:02:a5:df:01:d9 brd ff:ff:ff:ff:ff:ff

    inet 20.0.0.249/24 brd 20.0.0.255 scope global eth0

3: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc htb qlen 1000

    link/ether 00:0d:88:2d:94:80 brd ff:ff:ff:ff:ff:ff

    inet 10.0.50.1/24 brd 10.0.50.255 scope global eth1

4: gre0: <NOARP> mtu 1476 qdisc noop

    link/gre 0.0.0.0 brd 0.0.0.0

5: tunnel0@NONE: <POINTOPOINT,MULTICAST,NOARP,UP> mtu 1476 qdisc noqueue

    link/gre 20.0.0.249 peer 20.0.0.250

    inet 192.168.2.4/24 scope global tunnel0

2) Where did 'gre0' come from? This leads me to belive all of my traffic are going thought this interface.

zebra-TestLinux# show interface

Interface eth0 is up, line protocol detection is disabled

index 2 metric 1 mtu 1500 <UP,BROADCAST,RUNNING,MULTICAST>

HWaddr: 00:02:a5:df:01:d9

inet 20.0.0.249/24 broadcast 20.0.0.255

input packets 13724, bytes 872184, dropped 0, multicast packets 0

input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

output packets 19637, bytes 2395991, dropped 0

output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

collisions 41

Interface eth1 is up, line protocol detection is disabled

index 3 metric 1 mtu 1500 <UP,BROADCAST,MULTICAST>

HWaddr: 00:0d:88:2d:94:80

inet 10.0.50.1/24 broadcast 10.0.50.255

input packets 0, bytes 0, dropped 0, multicast packets 0

input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

output packets 13, bytes 828, dropped 0

output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

collisions 0

Interface gre0 is down

index 4 metric 1 mtu 1476 <NOARP>

input packets 0, bytes 0, dropped 0, multicast packets 0

input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

output packets 0, bytes 0, dropped 0

output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

collisions 0

Interface lo is up, line protocol detection is disabled

index 1 metric 1 mtu 16436 <UP,LOOPBACK,RUNNING>

inet 127.0.0.1/8

input packets 2098, bytes 2234827, dropped 0, multicast packets 0

input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

output packets 2098, bytes 2234827, dropped 0

output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

collisions 0

Interface tunnel0 is up, line protocol detection is disabled

index 5 metric 1 mtu 1476 <UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>

inet 192.168.2.4/24 pointopoint 192.168.2.4

input packets 0, bytes 0, dropped 0, multicast packets 0

input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

output packets 0, bytes 0, dropped 0

output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

collisions 0

rip-TestLinix# show ip rip

Codes: R - RIP, C - connected, S - Static, O - OSPF, B - BGP

Sub-codes:

(n) - normal, (s) - static, (d) - default, (r) - redistribute,

(i) - interface

Network Next Hop Metric From Tag Time

C(i) 10.0.50.0/24 0.0.0.0 1 self 0

C(i) 192.168.2.0/24 0.0.0.0 1 self 0

rip-TestLinix# show ip rip status

Routing Protocol is "rip"

Sending updates every 30 seconds with +/-50%, next due in 6 seconds

Timeout after 180 seconds, garbage collect after 120 seconds

Outgoing update filter list for all interface is not set

Incoming update filter list for all interface is not set

Default redistribution metric is 1

Redistributing:

Default version control: send version 2, receive version 2

Interface Send Recv Key-chain

eth1 2 2

tunnel0 2 2

Routing for Networks:

    10.0.50.0/24

    192.168.2.0/24

Routing Information Sources:

Gateway BadPackets BadRoutes Distance Last Update

Distance: (default is 120)

[root@TestLinux root]# ip -s link ls tunnel0

5: tunnel0@NONE: <POINTOPOINT,MULTICAST,NOARP,UP> mtu 1476 qdisc noqueue

link/gre 20.0.0.249 peer 20.0.0.250

Quoted 45 lines

RX: bytes packets errors dropped overrun mcast

672 8 0 0 0 0

TX: bytes packets errors dropped carrier collsns

864 8 0 0 0 0

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#2 lore raw
In reply to Michael Tedesco

Thank you for you help but it is not an IP conflict. Here are the IPs and masks on each interface.
Linux - eth0 20.0.0.249/24
Linux tunnel is 192.168.2.4/24
Cisco FastEthernet3/0 is 20.0.0.250/24
Cisco tunnel address is 192.168.2.2/24

Cisco configuration for the tunnel
!
interface Tunnel0
ip address 192.168.2.2 255.255.255.0
ip rip send version 2
ip rip receive version 2
tunnel source FastEthernet3/0
tunnel destination 20.0.0.249
!

Mike Tedesco

Technical Operation Engineer

Broadband Maritime Inc.
61 Broadway, 19th floor
New York, NY 10006

Tel: 212-405-1055

Fax: 212-202-7990
Cell: 518-892-1172

[email protected]

This message is for the named person's use only. It may contain confidential, proprietary or legally privileged material. You must not, directly or indirectly, disclose, distribute, forward or copy any part of this message or any of its attachments without the permission of Broadband Maritime Inc.

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Joe Nuts
Sent: Monday, February 14, 2005 1:39 AM
To: Michael Tedesco
Cc: [email protected]
Subject: Re: [LARTC] GRE tunnel problems

Hi Michael,
To answer your two questions first,
1) about the rtnetlink error when trying to add the route : in my experience, when creating the gre tunnel, it automatically creates the route for you when you set the link to 'up' and add an address to the device.
you need to make sure you put the /xx netmask after the address though, so it knows what route to create. if you dont put anything after it, it will assume a /32, and you wont get any auto-created routes. (probably not what you want).
either way, you can check your existing routes with the 'ip route' command

2) I'm assuming the gre device is created when you modprobe gre. I have gre built in to my kernel, so the device always exists for me.

as for why it's not working, it might have something to do with your IP's conflicting.

from the output you gave, it looks like linux/eth0 has the IP 20.0.0.249, as does the cisco/eth0.
same goes for the tunnel. both devices have the 192.168.2.4 IP.

if you want everything to work right, the linux and cisco devices will need independent IP's.

to change the IP on the linux, you can do this :
#ip address del 20.0.0.249/24 dev eth0
#ip address add 20.0.0.250/24 dev eth0
#ip address del 192.168.2.4/24 dev tunnel0
(assuming 192.168.2.5 isnt taken)
#ip address add 192.168.2.5/24 dev tunnel0
and of course, your tunnel remote and local will have to be swapped use the following command when you create your tunnel. [root@TestLinux root]# ip tunnel add tunnel0 mode gre remote 20.0.0.249 local 20.0.0.250

Good Luck
-Joe

Quoted 12 lines · Michael Tedesco

Hello,

Here is my network:

            ------------------                             -------------
Quoted 7 lines

----------- Linux box ----------- GRE --------- Cisco ----------

            ------------------                             -------------

What I wan to accomplish. I want ripv2 to go across (both ways) through

the

Quoted 5 lines

GRE tunnel.

No packets are being passed thought the GRE tunnel0. So first I have to

fix

Quoted 1 line

my GRE tunnel. Well it seems that way anyways. I also have two questions

at

Quoted 68 lines

the below in bold. If you need anymore info please ask.

I am using quagga and ripd daemons also.

Quagga version - quagga-0.96.4-1.1

Kernal version - Linux 2.6.10

Mike

This is how I configure my GRE tunnel:

[root@TestLinux root]# modprobe ip_gre

[root@TestLinux root]# ip tunnel add tunnel0 mode gre remote 20.0.0.250 local 20.0.0.249

[root@TestLinux root]# ip link set tunnel0 up

[root@TestLinux root]# ip addr add 192.168.2.4/24 dev tunnel0

[root@TestLinux root]# ip route add 192.168.2.0/24 dev tunnel0

RTNETLINK answers: File exists

[root@TestLinux root]# ip link set dev tunnel0 multicast on

1) I do not know what 'RTNETLINK answers: File exists' mean beside maybe that the route was automatically created.? I created the route though the tunnel before and this message never came up before.

[root@TestLinux root]# ip addr ls

1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

    inet 127.0.0.1/8 scope host lo

2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc htb qlen 1000

    link/ether 00:02:a5:df:01:d9 brd ff:ff:ff:ff:ff:ff

    inet 20.0.0.249/24 brd 20.0.0.255 scope global eth0

3: eth1: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc htb qlen 1000

    link/ether 00:0d:88:2d:94:80 brd ff:ff:ff:ff:ff:ff

    inet 10.0.50.1/24 brd 10.0.50.255 scope global eth1

4: gre0: <NOARP> mtu 1476 qdisc noop

    link/gre 0.0.0.0 brd 0.0.0.0

5: tunnel0@NONE: <POINTOPOINT,MULTICAST,NOARP,UP> mtu 1476 qdisc noqueue

Quoted 7 lines
    link/gre 20.0.0.249 peer 20.0.0.250

    inet 192.168.2.4/24 scope global tunnel0

2) Where did 'gre0' come from? This leads me to belive all of my traffic

are

Quoted 160 lines

going thought this interface.

zebra-TestLinux# show interface

Interface eth0 is up, line protocol detection is disabled

index 2 metric 1 mtu 1500 <UP,BROADCAST,RUNNING,MULTICAST>

HWaddr: 00:02:a5:df:01:d9

inet 20.0.0.249/24 broadcast 20.0.0.255

input packets 13724, bytes 872184, dropped 0, multicast packets 0

input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

output packets 19637, bytes 2395991, dropped 0

output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

collisions 41

Interface eth1 is up, line protocol detection is disabled

index 3 metric 1 mtu 1500 <UP,BROADCAST,MULTICAST>

HWaddr: 00:0d:88:2d:94:80

inet 10.0.50.1/24 broadcast 10.0.50.255

input packets 0, bytes 0, dropped 0, multicast packets 0

input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

output packets 13, bytes 828, dropped 0

output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

collisions 0

Interface gre0 is down

index 4 metric 1 mtu 1476 <NOARP>

input packets 0, bytes 0, dropped 0, multicast packets 0

input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

output packets 0, bytes 0, dropped 0

output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

collisions 0

Interface lo is up, line protocol detection is disabled

index 1 metric 1 mtu 16436 <UP,LOOPBACK,RUNNING>

inet 127.0.0.1/8

input packets 2098, bytes 2234827, dropped 0, multicast packets 0

input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

output packets 2098, bytes 2234827, dropped 0

output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

collisions 0

Interface tunnel0 is up, line protocol detection is disabled

index 5 metric 1 mtu 1476 <UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>

inet 192.168.2.4/24 pointopoint 192.168.2.4

input packets 0, bytes 0, dropped 0, multicast packets 0

input errors 0, length 0, overrun 0, CRC 0, frame 0, fifo 0, missed 0

output packets 0, bytes 0, dropped 0

output errors 0, aborted 0, carrier 0, fifo 0, heartbeat 0, window 0

collisions 0

rip-TestLinix# show ip rip

Codes: R - RIP, C - connected, S - Static, O - OSPF, B - BGP

Sub-codes:

(n) - normal, (s) - static, (d) - default, (r) - redistribute,

(i) - interface

Network Next Hop Metric From Tag Time

C(i) 10.0.50.0/24 0.0.0.0 1 self 0

C(i) 192.168.2.0/24 0.0.0.0 1 self 0

rip-TestLinix# show ip rip status

Routing Protocol is "rip"

Sending updates every 30 seconds with +/-50%, next due in 6 seconds

Timeout after 180 seconds, garbage collect after 120 seconds

Outgoing update filter list for all interface is not set

Incoming update filter list for all interface is not set

Default redistribution metric is 1

Redistributing:

Default version control: send version 2, receive version 2

Interface Send Recv Key-chain

eth1 2 2

tunnel0 2 2

Routing for Networks:

    10.0.50.0/24

    192.168.2.0/24

Routing Information Sources:

Gateway BadPackets BadRoutes Distance Last Update

Distance: (default is 120)

[root@TestLinux root]# ip -s link ls tunnel0

5: tunnel0@NONE: <POINTOPOINT,MULTICAST,NOARP,UP> mtu 1476 qdisc noqueue

link/gre 20.0.0.249 peer 20.0.0.250

Quoted 45 lines

RX: bytes packets errors dropped overrun mcast

672 8 0 0 0 0

TX: bytes packets errors dropped carrier collsns

864 8 0 0 0 0

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/