Visit Our UNIX and Linux User Community


Assigning a static IP to NICs


 
Thread Tools Search this Thread
Operating Systems Solaris Assigning a static IP to NICs
# 1  
Old 01-02-2008
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
# 2  
Old 01-02-2008
What does routing look like?

Code:
route -vn

(I think this is correct for Solaris)
# 3  
Old 01-02-2008
Quote:
Originally Posted by Neo
What does routing look like?

Code:
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

Last edited by sunfan; 01-02-2008 at 05:18 PM..
# 4  
Old 01-02-2008
what does netstat -rn show? And is /etc/defaultrouter set to the ip of your router?
# 5  
Old 01-02-2008
Quote:
Originally Posted by theninja
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
# 6  
Old 01-02-2008
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
# 7  
Old 01-02-2008
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?

Previous Thread | Next Thread
Test Your Knowledge in Computers #422
Difficulty: Medium
C# has support for strongly-typed function pointers via the keyword delegate.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Linux with two NICs

Hello All, I have Linux box with two interface cards. Every card has it's own IP Address and Gateway, IP addresses are from different subnets. eth0 192.168.1.10/24 GW 192.168.1.1 eth1 192.168.2.10/24 GW 192.168.2.1 Third PC is located in 192.168.13.0/24 network and is trying to access... (2 Replies)
Discussion started by: AndreiM
2 Replies

2. IP Networking

Networking 2 NICs

Hi all, Host - Ubuntu 12.04 desktop 64bit Virtualizer - Oracle VirtualBox 2 NICs Where can I find relevant document to set up 2 NICs, one for inward bound and another for outward bound, separate channel, both connected to the same router Would following document be appropriate for my... (1 Reply)
Discussion started by: satimis
1 Replies

3. Hardware

How to get into BIOS and disable NICS?

Hi, I have to get into BIOS and disable onbaord NICS for an IBM server, can someone please help me out. I tried hitting F1 when reboot to get into BIOS, but it seems like a setup screen and I dont see any option to disable NICS? Thanks Sam (2 Replies)
Discussion started by: sam4919
2 Replies

4. Programming

Even the Static cURL Library Isn't Static

I'm writing a program which uses curl to be run on Linux PCs which will be used by a number of different users. I cannot make the users all install curl on their individual machines, so I have tried to link curl in statically, rather than using libcurl.so. I downloaded the source and created a... (8 Replies)
Discussion started by: BrandonShw
8 Replies

5. Programming

C++ program is crashing on re-assigning const static member variable using an int pointer

Hi, Can any one tell me why my following program is crashing? #include <iostream> using namespace std; class CA { public: const static int i; }; const int CA::i = 10; int main() { int* pi = const_cast<int*>(&CA::i); *pi = 9; cout << CA::i << endl; } (6 Replies)
Discussion started by: royalibrahim
6 Replies

6. IP Networking

I need HELP to Set up Coyote Linux router with 1 static IP & 64 internal static IP

hello, i need help on setting my coyote linux, i've working on this for last 5 days, can't get it to work. I've been posting this message to coyote forum, and other linux forum, but haven't get any answer yet. Hope someone here can help me...... please see my attached picture first. ... (0 Replies)
Discussion started by: dlwoaud
0 Replies

7. Linux

Two NICs one IP address

I'm looking for a way in RHL 5.1 to use two NICs on one host with two physical IP addresses and map them under one virtual IP address, i.e. NIC 1 10.10.10.1 NIC2 10.10.10.2 VIP 192.168.10.1 Basically I want either one of the NICs to ARP for the VIP. No load balancing required just HA. (2 Replies)
Discussion started by: wschmied
2 Replies

8. Solaris

How many NICS do I have?

Hi, is there a way in Solaris 8 to determine how many total NIC's say a Sun Sparc box has installed - plumbed or unplumbed - and find out its capable network speeds and MAC address? I know ifconfig -a but that only shows the plumbed and used interfaces. thx cc (2 Replies)
Discussion started by: bigapple100
2 Replies

9. IP Networking

FreeBSD and two NICs

FreeBSD 4.8, Apache 1.3.27 - two NICs, one with a real-world IP plugged into a switch outside the PIX firewall, the other with a private IP plugged into a switch inside the PIX firewall. Apache listens on both IPs. my domain is mydomain.org. so in /etc/rc.conf i have something like this (these... (10 Replies)
Discussion started by: ednix
10 Replies

10. AIX

Merge NICs

Hi friends, I installed oracle 10g (10.2.0.2) RAC on 2 IBM p5 570 servers running AIX 5.3ML04 and HACMP5.2 (used Raw devices, not used GPFS). Each server has 4 x 1Gbps ethernet cards (NICs), en0 and en1 for boot address, en2 and en3 for oracle interconnect. Now i want to merge 2 NICs (en2 and... (1 Reply)
Discussion started by: bong02
1 Replies

Featured Tech Videos