0

I have access to a remote machine which has two network interfaces, eth0 is connected to same network I am in, so I am able to connect to it. But I need to test some usecases on eth1 but I am not sure whether it is connected to a router or not.

How can I verify that it is connected to a router ? I can see that it has no inet address but has inet6 , what does this mean ?

I have deleted IPv6 Address from below

eth1      Link encap:Ethernet  HWaddr (deleted)
          inet6 addr: (deleted IPV6 Address)/64 Scope:Global
          inet6 addr:  (deleted IPV6 Address)/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:146 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:10139 (9.9 KiB)  TX bytes:406 (406.0 b)
4
  • 1
    You should at least show the first two octets of the IPv6 addresses (those up to four hex digits up to the first colon) and tell us if there is the combination ..ff:fe.. in it. It looks like the interface has a standard link local address (like every IPv6 capable interface) and a global address that could have been provided by the router or set statically on the device. Did you configure a static IPv6 address? Oh, and do you specifically mean "connected to a router" or "connected to any other device"?
    – Dubu
    Jul 25, 2013 at 6:27
  • @Dubu Here are the first two octets. For Global : 2002 for Link : fe80 . Yes there is a combination of ff:fe in inet6. As far as I know router is configured for DHCP. I specifically meant connected to a router. Jul 25, 2013 at 6:47
  • 1
    Yes there is a combination of ff:fe in inet6. -- In both of them? If you have the ff:fe in the global address (starting with 2002:), then this address is most probably configured via stateless address auto-configuration (SLAAC) or perhaps DHCPv6, using a prefix from the router, and then you are connected to a router.
    – Dubu
    Jul 25, 2013 at 7:07
  • @Dubu yes ff:fe is present in both of them Jul 25, 2013 at 7:27

2 Answers 2

1

I think you can use the command ethtool

My ethernet interface is eth0

Example:

This is the sample output of ethool eth0 (When Connected)

[root@localhost ~]# ethtool eth0

.
.
.

Link detected: yes ------> Last Line

Not Connected

.
.
.

Link detected: no
1

Use ping with -I key and IPv4:

ping -I eth0 -c 1 ROUTER_IPv4
ping -I eth1 -c 1 ROUTER_IPv4

Example:

hostname ~ # ping -I eth0 -c 1 192.168.1.1
PING 192.168.1.1 (192.168.1.1) from 192.168.1.3 eth0: 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.314 ms

--- 192.168.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.314/0.314/0.314/0.000 ms
hostname ~ # echo $? 
0 
hostname ~ # ping -I eth1 -c 1 192.168.1.1
PING 192.168.1.1 (192.168.1.1) from 192.168.1.3 eth0: 56(84) bytes of data. 
From 192.168.1.3: icmp_seq=1 Destination Host Unreachable 

--- 192.168.1.1 ping statistics --- 
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms 
hostname ~ # echo $?
1
hostname ~ #

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .