Sponsored Content
Operating Systems Solaris How can I find which NIC is used to talk to a given host (except traceroute) Post 302624227 by radoulov on Monday 16th of April 2012 03:51:16 AM
Old 04-16-2012
I'm not a Solaris networking expert by any means, but I believe that the route command gives
you the interface that should be used:

Code:
route get <destination>

I don't know if there are exceptions or corner cases.

This output is from a virtual machine on my PC:

Code:
bash-3.2$ /sbin/ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e1000g0: flags=1004843<UP,BROADCAST,RUNNING,MULTICAST,DHCP,IPv4> mtu 1500 index 2
        inet 10.0.2.15 netmask ffffff00 broadcast 10.0.2.255
e1000g1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
        inet 169.254.1.6 netmask ffff0000 broadcast 169.254.255.255
bash-3.2$ /sbin/route get 169.254.1.4
   route to: 169.254.1.4
destination: 169.254.0.0
       mask: 255.255.0.0
  interface: e1000g1
      flags: <UP,DONE>
 recvpipe  sendpipe  ssthresh    rtt,ms rttvar,ms  hopcount      mtu     expire
       0         0         0         0         0         0      1500         0
bash-3.2$ /sbin/route get 10.0.2.16
   route to: 10.0.2.16
destination: 10.0.2.0
       mask: 255.255.255.0
  interface: e1000g0
      flags: <UP,DONE>
 recvpipe  sendpipe  ssthresh    rtt,ms rttvar,ms  hopcount      mtu     expire
       0         0         0         0         0         0      1500         0


Last edited by radoulov; 04-16-2012 at 08:51 AM..
This User Gave Thanks to radoulov For This Post:
 

10 More Discussions You Might Find Interesting

1. Solaris

How do I find what kind of NIC card the server has?

All, I see that there are 2 nic card available . How can I know all the details about these 2 nic cards. -rw-r--r-- 1 root root 10 Apr 16 15:00 hostname.bge0 -rw-r--r-- 1 root other 17 Apr 22 08:56 hostname.bge2 please let me know thanks -prasad (4 Replies)
Discussion started by: p4cldba
4 Replies

2. UNIX for Advanced & Expert Users

Help! How to find the local host after few ssh hops to remote host???

I do a ssh to remote host(A1) from local host(L1). I then ssh to another remote(A2) from A1. When I do a who -m from A2, I see the "connected from" as "A1". => who -m userid pts/2 2010-03-27 08:47 (A1) I want to identify who is the local host who initiated the connection to... (3 Replies)
Discussion started by: gomes1333
3 Replies

3. Solaris

Mulitple Zones on Dual NIC host

Greetings Forumers! I am running into an issue with multiple zones on an M5000 with 2 NICs. The NICs are on separate VLANs. These zones are using the 2 NICs to communicate with other systems but when they need to communicate with a zone on the same system, but different NIC, the application... (9 Replies)
Discussion started by: bluescreen
9 Replies

4. AIX

AIX -How to find which NIC is on which PCI card

Hi All, How can I find out which is ETH5 on my AIX P5 system. I have about seven different NIC card on this. I did move the cable to each one but still I was not able to see the link light up when I did netstat -v Any idea? Thanks. (2 Replies)
Discussion started by: samnyc
2 Replies

5. Solaris

Not able to find the new NIC

I have a Sun Blade 2500 with SUN 5.9 OS installed. I have one NIC built-in which is working fine. I insert another new NIC in the machine with four RJ45 connector options(means four NICs in one Card). The problem is i am not able to see the new NIC Thanks (13 Replies)
Discussion started by: z_haseeb
13 Replies

6. Solaris

able to ping all hosts but not able to traceroute any host

i am using solaris 10 and i am able to ping all the hosts but i am not able to traceroute any of them. how to fix this? (9 Replies)
Discussion started by: chidori
9 Replies

7. Solaris

x86 Solaris 10 nic driver added but not attached. NIC is not detected.

I couldn't install my nic in solaris 10. I compiled and added the driver but failed to attach the driver and ifconfig output shows only loopback dev. Please see the following output and tell me whether my nic has been detected and why the driver failed to attach? My nic is detected in linux... (0 Replies)
Discussion started by: vectrum
0 Replies

8. Red Hat

I want to tune NIC's rps, rfs and xps value. which NIC device should I modify.

Dear All I want tune my NIC's rps, rfs and xps value. In my system I have two NIC (eth0, eth1) and I have a bond0 ( eth0, eth1). Here is the question? Which device should I modify ? eth0 and eth1? or just modify bond0 or modify all device (eth0, eth1, bond0) Any advice is welcome.... (0 Replies)
Discussion started by: nnnnnnine
0 Replies

9. Solaris

Network issue on multinic. Unable to ping a host from One NIC but other works

Dear, I hope you all will be ok. I have an issue with Solaris box running on x86 Blade. I am unable to ping a node neither traceroute. I am able to do traceroute from oce0:6 port which have IP and subnet of same type which oce0:1 has. details are as follows: Problem: root@rinams02:/#... (3 Replies)
Discussion started by: khaniqshahid
3 Replies

10. Linux

Add two different subnet public IPs to single NIC or two different NIC on same box

Hello Admins, My ask is how can I add two different subnet IPs to same box with two different gateways? The issue is I can connect to the box when I am on ethernet LAN, but I am not able to connect to the same IP when I am on wifi. The server is RHEL 7 VM on vmware. How can I get connected... (4 Replies)
Discussion started by: snchaudhari2
4 Replies
route(8)						      System Manager's Manual							  route(8)

NAME
route - Manipulates the routing tables manually SYNOPSIS
Adding a Route route [-nqvC] add [-net|-host] [family] destination[/bitmask] gateway [-link] [modifiers [args]] Changing a Route route [-nqv] change [-net|-host] [family] destination gateway [-link] [modifiers [args]] Monitoring a Route route [-n] monitor Deleting a Route route [-nqvC] delete [-net|-host] [family] destination[/bitmask] [-link] gateway [modifiers [args]] Deleting All Routes route [-nqvC] flush [family] FLAGS
Prints host and network names in numeric format, instead of symbolic format, when reporting actions. Suppresses all output. Causes addi- tional details to be printed. Forces route to use the old ioctl calls instead of the current route server request path. PARAMETERS
Specifies explicitly that this route is a network route; destination is interpreted as a network address. Specifies explicitly that this route is a host route; destination is interpreted as a host address. Specifies the destination host or network (with or without the optional Classless Inter-Domain Routing (CIDR) mask (/bitmask)). Specifies the optional address family of the destination and gateway parameters. Possible values are: -inet (the default) and -inet6. If the -link parameter is not specified, this also specifies the address family of the gateway parameter. Specifies that the gateway is a link layer address. If the -link parameter is not specified, the address family of the gateway parameter is the same as the destination. Specifies the next hop and gateway to which packets should be addressed. DESCRIPTION
The route command is a program used to manually manipulate the network routing tables. It normally is not needed, as a system routing ta- ble management daemon, such as gated or routed, should tend to this task. The route command accepts five commands: Adds a route. Removes all gateway entries from the routing tables. For the inet6 family, it also removes all cloned routes. You can choose to flush only those routes whose destinations are of a given address family by specifying an optional keyword (family) that specifies the address family. Deletes a specific route. Changes aspects of a route (such as its gateway). Reports any changes to the routing information base, routing lookup misses, or suspected network partionings. Unless the -net or -host parameters are specified on the command line, route creates a host route or a network route by interpreting the Internet address associated with destination parameter. If the destination has a local address part of INADDR_ANY, or if the destination is the symbolic name of a network, a network route is created; otherwise, a host route is created. For example, 128.32 is interpreted as -host 128.0.0.32, 128.32.130 is interpreted as -host 128.32.0.130; -net 128.32 is interpreted as 128.32.0.0, and -net 128.32.130 is interpreted as 128.32.130.0. All symbolic names specified for a destination or gateway are looked up first as a hostname using gethostbyname(3). If this lookup fails, getnetbyname(3) is then used to interpret the name as that of a network. Routes added with the route command are marked as RTF_STATIC to differentiate them from routes added by the routing daemons (gated or routed). The gated daemon does not remove the RTF_STATIC routes when it is shut down. The route command uses a routing socket and the new message types RTM_ADD, RTM_DELETE, and RTM_CHANGE. Modifiers Modifiers provide initial values to metrics and other information maintained in the routing entry. All modifiers and their arguments are optional and must appear after the gateway field on the command line. The modifiers for the add, change, and delete commands are as fol- lows: Specifies that the kernel add or delete the specified route on all interfaces (for example, tu0 and tu1) that are in the same subnet as the gateway. Use this modifier only with the add and delete modifiers. Do not use -all with the -dev and -olddev modifiers. Specifies that this route is a blackhole route. Packets sent to blackhole routes are dropped, and no notification is sent to the packet originators. This is different from a normal route, which allows packets to be forwarded out on it. You must specify 127.0.0.1 (localhost) as the gate- way argument. Generates a new route on use of this route. Specifies the interface device (for example, tu0 and fta0) to use in the rout- ing entry. Use this modifier when you want to designate a particular interface for a route. If you do not specify this modifier, the route is added on the first interface that is found. Specifies that the netmask mask is used for all routes cloned from this route. Sets this route's maximum hopcount to count. Specifies that this route is via an interface instead of via a gateway (gateway is the default). This means the destination is reachable directly via an interface; no intermediate system is required. The gateway parameter is the address of this host on the common network, indicating the interface to be used for transmission. Sets this route's type as AF_INET. When used with the delete or flush commands, only AF_INET routes are deleted. Sets this route's type as AF_INET6. When used with the delete or flush commands, only AF_INET6 routes are deleted. Sets this route's type as AF_ISO. When used with the delete or flush commands, only AF_ISO routes are deleted. Sets this route's type as AF_LINK. When used with the delete or flush commands, only AF_LINK routes are deleted. Specifies that this route contains valid link-layer information. Locks the metric set by next modifier specified on the command line in the routing entry. A locked metric is not modified by the kernel. The following metrics can be locked: mtu, hopcount, recvpipe, sendpipe, ssthresh, rtt, and rttvar. Locks the metrics set by all modifiers that follow on the command line in the routing entry. A locked metric is not modified by the kernel. The following metrics can be locked: mtu, hopcount, recvpipe, sendpipe, ssthresh, rtt, and rttvar. Sets this route's maximum transmission unit (MTU), in bytes, to size. Specifies the subnet mask to use for the routing entry. Networks that use a nonstandard subnet must include this modifier. Specify this modifier after any optional modifiers. Do not specify this modifier if you specify a CIDR bitmask (/bitmask). Do not specify this modifier with the change command. Specifies that fragment to path MTU size is disabled for this route. Specifies that path MTU discovery is disabled for this route. Specifies the old interface device (for example, tu0 and fta0) in the routing entry that you want to change. Use this modifier with the change command only to move a route from one interface to another. See the "Examples" section. Specifies the old gateway in the routing entry that you want to change. Use this modifier with the change command only. See the "Examples" section. Specifies the old interface in the routing entry that you want to change. Use this modifier with the change command only. Sets this route's type as AF_ISO. When used with the delete or flush commands, only AF_ISO routes are deleted. Sets the precedence of the route to value. Among equivalent routes to the same destination, the route with the lower precedence is preferred. Sets this route's inbound delay bandwidth product (in bytes) to bandwidth. Specifies that this route is a reject route. Packets sent to reject routes are dropped and messages designating the route as unreachable are sent to the packet originators. This is different from a normal route, which allows packets to be forwarded out on it. You must specify 127.0.0.1 (localhost) as the gateway argument. Sets this route's round trip time (in microseconds) to time. Sets this route's round trip time vari- ance (in microseconds) to variance. Sets this route's outbound delay bandwidth product (in bytes) to bandwidth. Sets this route's out- bound gateway buffer limit (in bytes) to threshold. RESTRICTIONS
You must be superuser in order to run the route command and to modify the routing tables. EXAMPLES
To add gateway 128.32.0.130 as a default gateway, enter: route add default 128.32.0.130 To add a route to host milan via gateway 128.32.0.130, enter: route add -host milan 128.32.0.130 To delete an existing route via gateway 128.32.0.130 to host milan, enter: route delete -host milan 128.32.0.130 To add a route with a precedence value of 1 to host milan via gateway 128.32.0.130, enter: route add -precedence 1 -host milan 128.32.0.130 To change an existing route for host milan via gateway 128.32.0.130 to use a new gateway 128.32.10.101, enter: route change -oldgateway 128.32.0.130 -oldinterface le0 -host milan 128.32.10.101 To add a route to net- work 212.232.32 via gateway 128.32.0.130, enter: route add -net 212.232.32/22 128.32.0.130 The previous example aggregates routes for four Class C networks: 212.232.32, 212.232.33, 212.232.34, and 212.232.35. To add an IPv6 route to network feco:10:50::/48 through the configured tunnel interface ipt0, enter: route add -inet6 fec0:10:50::48 -inet6 fe80::a0a:2805 -dev ipt0 To add a route to network 212.232.32/22 via gateway 128.32.0.130 and lock the MTU size at 1500, enter: route add -net 197.45.63/24 214.89.32.235 -lock -mtu 1500 To add a route to network 212.232.32/22 via gateway 128.32.0.130 and lock the MTU size and hop count, enter: route add -net 197.45.63/24 214.89.32.235 -lockrest -mtu 1500 -hopcount 2 To change existing network route 206.98.17 via gateway 206.98.17.45 from using interface device tu0 to tu1, enter: route change -net 206.98.17 206.98.17.45 -olddev tu0 -dev tu1 This assumes that interface device tu1 is config- ured with an IP address in the same subnet as tu0. To change existing network route 206.98.17 from using gateway 206.98.17.45 to 206.98.17.162, enter: route change -net 206.98.17 206.98.17.162 -oldgateway 206.98.17.45 To change existing network route 206.98.17 using interface device tu0 and gateway 206.98.17.45 to use device tu1 and gateway 206.98.17.162, enter: route change -net 206.98.17 206.98.17.162 -olddev tu0 -dev tu1 -oldgateway 206.98.17.45 To add a route to host 219.67.129.16 via gateway 219.67.122.41 using interface device tu1, enter: route add -host 219.67.129.16 219.67.122.41 -dev tu1 To delete a route to network 219.84.6 via gateway 219.84.6.79 using interface device fta0, enter: route delete -net 219.84.6 219.84.6.79 -olddev fta0 To add a route to host 202.54.164.79 via gateway 202.54.163.11 using all interfaces connected to the 202.54.163/24 subnet, enter: route add -host 202.54.164.79 202.54.163.11 -all DIAGNOSTICS
The specified route is being added to the tables. If the gateway address used was not the primary address of the gateway (the first one returned by gethostbyname), the gateway address is printed numerically as well as symbolically. The optional /bitmask parameter was speci- fied with the change command. Do not specify a bit mask with the change command. The specified route is being modified in the tables. The specified route is being deleted from the tables. If the gateway address used was not the primary address of the gateway (the first one returned by gethostbyname), the gateway address is printed numerically as well as symbolically. When you use the flush command, each routing table entry deleted is indicated with a message of this form. An add operation was attempted for an entry that already exists in the routing tables. The gateway value is incorrect for creating reject and blackhole routes. The bitmask specified is not in the range of 1 to 32, inclusive. The -netmask modifier was specified together with a CIDR bit mask. The optional -netmask modifier was specified with the change command. Do not specify a network mask with the change command. An attempt to add a route failed because the gateway listed was not on a directly connected network. The next hop gateway must be given. A delete operation was attempted for an entry that was not present in the tables. An add operation was attempted, but the system was low on resources and was unable to allocate memory to create the new entry. FILES
Specifies the command path RELATED INFORMATION
Commands: netstat(1), gated(8), routed(8). Networking: netintro(7). delim off route(8)
All times are GMT -4. The time now is 02:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy