Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

I am able to connect remotely to the machine using SSH, but I cannot ping through the machine.

I did the following to make sure SSH was enabled (well I know it is, as I am using PuTTy):

# svcs ssh
STATE          STIME    FMRI
online          9:56:08 svc:/network/ssh:default

The machine name is:

# uname -a
SunOS solaris 5.11 11.1 i86pc i386 i86pc

And the precise version is:

# cat /etc/release
Oracle Solaris 11.1 X86
Copyright (c) 1983, 2012, Oracle and/or its affiliates.  All rights reserved.
Assembled 19 September 2012

I am trying to install gcc, but it cannot contact valid package repository:

# pkg install gcc-45
pkg: 0/1 catalogs successfully updated:

Unable to contact valid package repository
Encountered the following error(s):
Unable to contact any configured publishers.
This is likely a network configuration problem.
Framework error: code: 6 reason: Couldn't resolve host ''
URL: '' (happened 4 times)

I don't understand that SSH can work, but my internet is not open.

This is what ifconfig -a returns:

# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
    inet netmask ff000000
net0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
    inet netmask ff000000 broadcast
    ether 8:0:27:7:ad:7
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
    inet6 ::1/128
net0: flags=20002004841<UP,RUNNING,MULTICAST,DHCP,IPv6> mtu 1500 index 2
    inet6 fe80::a00:27ff:fe07:ad07/10
    ether 8:0:27:7:ad:7

net0 IPv4 is the correct IP address that I am using for SSH. The only way I could (possibly) get round it, is if I could edit the gateway and the DNS IP addresses.

Any help to get this machine to see the internet, would be greatly appreciated.

share|improve this question
Looks like a name resolution problem. Can you ping a host on the Internet by IP address from the Solaris machine? – D_Bye Nov 7 '13 at 12:23
can you post this: svccfg -s network/dns/client listprop config – BitsOfNix Nov 7 '13 at 12:35
also this seems a Virtual Machine are sure you have the correct setting on the nic side? – BitsOfNix Nov 7 '13 at 12:51
@Kevdog777 - That file simply contains the LAN IP address of the gateway host. You might need to run route add default (assuming that's the gateway IP address) to activate the change now. Putting it in the config file will mean it gets picked up next time the machine starts up. – D_Bye Nov 7 '13 at 14:35
@Kevdog777 - I've gathered the salient points from these comments into an answer. Should see you right! – D_Bye Nov 7 '13 at 15:11

1 Answer 1

up vote 1 down vote accepted

The message couldn't resolve host in the output to the pkg command suggests some fundamental misconfiguration of the network stack on the Solaris box. Given that you can connect to it over ssh from another machine on the LAN, we know its networking stack is initialised, and that it is passing packets correctly. The problem is therefore most likely to be due to a name resolution failure, or a missing gateway specification.

The simplest way to find out which problem is causing your lack of service, is just to try to ping a machine on the Internet by its IP address. A successful response means that routing is fine, and we then need to look at the name resolution settings on the box. If the ping fails, however, it should give you a reason why.

$ ping
ping: sendto No route to host

In this case, as you reported above in the comments, ping fails with a message that the network stack couldn't find a route to the remote host. On Solaris, there should be a file, /etc/defaultrouter, which contains the LAN IP address of your gateway machine. If that file doesn't exist, or contains the wrong IP address, that is the cause of your problem. Fix the file, and run route add default to install the new default route in the IP stack now.

When it boots, the system will automatically configure a default gateway based on the contents of /etc/defaultrouter - there should be no need to run the route add again manually.

share|improve this answer
I'm not sure your answer is true to the spirit of Solaris 11 (as opposed to Solaris 10). Isn't fiddling with /etc/defaultrouter file the old way of doing things? I would simply do route -p add default Again I'm struggling to learn the new ways myself so this is more of a question than something I'm sure of. – unixhacker2010 Nov 16 '13 at 10:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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