Assigning a static IP to NICs

Hi,

I have checked the net and can't find why I can't ping the server nor can I ping any address inside or outside the network from the server (using serial connection). I can set up DHCP on the server and it gets an address of 192.168.1.118 and everything is fine. I cannot ping anything from the server including the router with the exception of the static address of 192.168.1.71.
I was unprepared when the initial questions came up about setting up the NICs not realizing the first two NICs would be named differently than the last two (nge0/nge1 and e1000g0/e1000g1).

I really wanted static but I couldn't find any setup information in documentation that indicated which interface was which. Now I'm trying to assign a static IP to nge0 and although I get the static IP I assigned, I cannot ping this IP (192.168.1.71).

Configuration details:

Server:
X4200 M2

OS:
Solaris 10 on Opteron system

/etc/hosts:
127.0.0.1 localhost
192.168.1.73 e1000g1
192.168.1.71 pluto1

/etc/inet/hosts:
127.0.0.1 localhost
192.168.1.73 e1000g1
192.168.1.71 pluto1

/etc/hostname.nge0
pluto1

/etc/inet/ipnodes:
::1 localhost
127.0.0.1 localhost
192.168.1.73 e1000g1
192.168.1.71 pluto1

/etc/nodename:
pluto1

Output from ipconfig -a:
root@pluto1 # ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g1: flags=1000803<UP,BROADCAST,MULTICAST,IPv4> mtu 1500 index 2
inet 192.168.1.73 netmask ffffff00 broadcast 192.168.1.255
ether 0:14:4f:8d:c9:9d
nge0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 192.168.1.71 netmask ffffff00 broadcast 192.168.1.255
ether 0:14:4f:8d:c9:9a
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
inet6 ::1/128
e1000g1: flags=2000801<UP,MULTICAST,IPv6> mtu 1500 index 2
inet6 fe80::214:4fff:fe8d:c99d/10
ether 0:14:4f:8d:c9:9d
nge0: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 3
inet6 fe80::214:4fff:fe8d:c99a/10
ether 0:14:4f:8d:c9:9a

What does routing look like?

route -vn

(I think this is correct for Solaris)

route -vn is incorrect syntax. If you're looking for routing information I believe netstat -r will give you what you're looking for.

I am not 100% sure what I'm looking at but I'll let you judge that.

root@pluto1 # netstat -r

Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
192.168.1.0 e1000g1 U 1 419 e1000g1
syslogd: line 24: WARNING: loghost could not be resolved
192.168.1.0 pluto1 U 1 0 nge0
224.0.0.0 pluto1 U 1 0 nge0
default 192.168.1.1 UG 1 15
localhost localhost UH 4 74 lo0

Also, this is what I get if I switch back to DHCP assigned addresses:
The only difference is the line that reads:
BASE-ADDRESS.MCAST.NET new-host-2 U 1 0 nge0
I don't know what this is.

root@new-host-2 # netstat -r

Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
192.168.1.0 new-host-2 U 1 3 nge0
192.168.1.0 e1000g1 U 1 0 e1000g1
BASE-ADDRESS.MCAST.NET new-host-2 U 1 0 nge0
default 192.168.1.1 UG 1 4 nge0
localhost localhost UH 2 42 lo0

Routing Table: IPv6
Destination/Mask Gateway Flags Ref Use If
--------------------------- --------------------------- ----- --- ------ -----
fe80::/10 fe80::214:4fff:fe8d:c99d U 1 0 e1000g1
fe80::/10 fe80::214:4fff:fe8d:c99a U 1 0 nge0
ff00::/8 fe80::214:4fff:fe8d:c99d U 1 0 e1000g1
localhost localhost UH 4 21 lo0

what does netstat -rn show? And is /etc/defaultrouter set to the ip of your router?

Yes, /etc/defaultrouter contains 192.168.1.1.

netstat -rn output:

Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
192.168.1.0 192.168.1.71 U 1 91 nge0
224.0.0.0 192.168.1.71 U 1 0 nge0
default 192.168.1.1 UG 1 91
127.0.0.1 127.0.0.1 UH 4 83 lo0

Routing Table: IPv6
Destination/Mask Gateway Flags Ref Use If
--------------------------- --------------------------- ----- --- ------ -----
fe80::/10 fe80::214:4fff:fe8d:c99d U 1 0 e1000g1
fe80::/10 fe80::214:4fff:fe8d:c99a U 1 0 nge0
ff00::/8 fe80::214:4fff:fe8d:c99d U 1 0 e1000g1
::1 ::1 UH 1 21 lo0

The output from netstat looks ok, the defaultrouter is set correctly,,,,,hmmmm

Can you ping pluto1? If not,

Check the /etc/nsswitch.conf file, it should show "files" first like so,,,

hosts: files dns
networks: files
ethers: files
netmasks: files

I assume hostname returns pluto1?

You can't ping the router at all?

Do you need IPv4 and IPv6 running? If not, turn off IPv6

From the root login prompt via serial interface I can ping pluto1. I can also ping all the interfaces so it must be doing something internal instead of going out on the network when I execute from the serial CLI login.

Results of ping attempt of router:
root@pluto1 # ping 192.168.1.1
no answer from 192.168.1.1

Results of hostname command:
root@pluto1 # hostname
pluto1

Contents of nsswitch.conf:

passwd: files
group: files

# You must also set up the /etc/resolv.conf file for DNS name
# server lookup. See resolv.conf(4).
hosts: files dns

# Note that IPv4 addresses are searched for in all of the ipnodes databases
# before searching the hosts databases.
ipnodes: files dns

networks: files
protocols: files
rpc: files
ethers: files
netmasks: files
bootparams: files
publickey: files
# At present there isn't a 'files' backend for netgroup; the system will
# figure it out pretty quickly, and won't use netgroups at all.
netgroup: files
automount: files
aliases: files
services: files
printers: user files

auth_attr: files
prof_attr: files
project: files

tnrhtp: files
tnrhdb: files

Would it be as simple as deleting the hostname.* files for IP6?

Something I thought might be helpful. I started moving the cable between the 4 ethernet ports and found that I can ping the e1000g0 NIC only. I can't ping any of the other 3 ports. All 4 now have static IPs with corresponding hostnames of pluto1 - pluto4.

I was thinking that you might have the cable in the wrong port. Could you post the output of ifconfig -a with DHCP enabled?
You will need to know which port is which at some point. I would suggest removing /etc/hostname.pluto2-4, reboot -- -r, and plug in the etho cable in each port until you get a link. Then label that port with the correct pluto1. You can repeat to label the rest.

Well son-of-a-gun. I don't know what was causing problems but I deleted all of them but nge0, connected the cable to it and it's pinging. Now I'll try bringing each of them up again and see if I start having the same problem.

Thanks so much for your patience and time!

Glad to hear it, Good Luck.