2

I'm trying to make a router inside GNS3 to connect to the host device (a Debian 8) with no success. Am I missing something?

enter image description here

DHCP works as expected:

!
interface FastEthernet0/0
 ip address dhcp
 duplex auto
 speed auto
!

IP is assigned to the router:

%DHCP-6-ADDRESS_ASSIGN: Interface FastEthernet0/0 assigned DHCP address 192.168.56.104, mask 255.255.255.0, hostname R1

When I ping from the host to the router I see (tcpdump) the ARP reply:

13:12:08.902370 ARP, Request who-has 192.168.56.104 tell 192.168.56.101, length 28
13:12:08.905452 ARP, Reply 192.168.56.104 is-at cc:01:43:49:00:00, length 46

But it is not populated in the host ARP table:

$ sudo arp -a
? (192.168.56.104) at <incomplete> on eth1

But it is on the router:

R1#sh arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  192.168.56.101          2   xxxx.xxxx.3f96  ARPA   FastEthernet0/0
Internet  192.168.56.104          -   cc01.4349.0000  ARPA   FastEthernet0/0

And when I ping from the router to the host, the host won't reply. A tcpdump capture on the host:

18:40:19.862855 ARP, Request who-has 192.168.56.101 tell 192.168.56.104, length 46
18:40:21.804763 ARP, Request who-has 192.168.56.101 tell 192.168.56.104, length 46
18:40:23.781876 ARP, Request who-has 192.168.56.101 tell 192.168.56.104, length 46

There is no rules in iptables:

$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination         
4
  • Can you ping the other way (router to host)?
    – Ron Trunk
    Commented Jun 30, 2017 at 18:18
  • No, it won't ping from any side.
    – Adriano P
    Commented Jun 30, 2017 at 20:58
  • Have you tried with a manual ARP entry on the host? Not likely, but maybe ARP is a problem.
    – Zac67
    Commented Jun 30, 2017 at 21:56
  • I did add a manual ARP, but it won't work either: sudo arp -s 192.168.56.104 cc:01:43:49:00:00
    – Adriano P
    Commented Jul 1, 2017 at 5:12

1 Answer 1

2

I've noticed this for quite awhile with GNS3. I imagine that while you can see the ARP's via wireshark on the host, the host isn't actually receiving them. They're being sent out the host interface as if it was generating the traffic. Hence, it doesn't respond to its "own" ARP.

There is probably a 'better' or 'more correct' way to get around this problem, but I found that creating a TAP interface on the host and bridging it with the physical interface using the ip command will suffice.

I'm able to provide the GNS3 router a DHCP address from my LAN via connecting it to a GNS3 cloud using the TAP interface I created on the host. The GNS3 router can reach all devices including the host, as well as the internet. Connectivity remains 'normal' on the host.

I don't recall what specific configuration may be necessary for the GNS3 cloud, as it automatically populated the TAP interface and offered it as a connection for the router. (You will probably have to start GNS3 after performing the below, however.)

Here's the script I use:

# Adjust these as desired.
PHY_INT=enp9s0
TUN_INT=tap0
BR_INT=br0

case "$1" in
        up)
                echo "Creating bridge ..."
                # Create bridge interface
                ip link add $BR_INT type bridge
                # Create TAP interface
                ip tuntap add $TUN_INT  mode tap
                ip link set $TUN_INT  up
                # Flush IP from physical interface
                ip add flush dev $PHY_INT
                # Add interfaces to bridge
                ip link set $TUN_INT master $BR_INT
                ip link set $PHY_INT master $BR_INT
                ip link set dev $BR_INT up

                # DHCP
                dhclient -v $BR_INT

                ;;
        down)
                echo "Removing bridge ..."
                ip link del $TUN_INT
                ip link del $BR_INT
                dhclient -v $PHY_INT
                ;;
        *)
                echo $"Usage: $0 {up|down}"
                exit 1
esac

I'm on Debian Stretch (9) and GNS3 2.0.3.

1
  • Excellent! I connected the router interface to the cloud br0 interface and voilà, it finally worked.
    – Adriano P
    Commented Jul 1, 2017 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.