LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   I install OSCAR / Problems with my 2 NICs / Need example /etc/hosts (https://www.linuxquestions.org/questions/linux-newbie-8/i-install-oscar-problems-with-my-2-nics-need-example-etc-hosts-783730/)

HermannPrechtl 01-21-2010 07:40 AM

I install OSCAR / Problems with my 2 NICs / Need example /etc/hosts
 
Dear All,

Please can you help me, I install at the moment OSCAR on CentOS 5.4 and have a lot of problems.

Please can you give me an example for the /etc/hosts? It's not really clear for me.

I've 2 NICs, one private for OSCAR and one public for Internet. I need only one fix IP-Address but how?

My /etc/hosts:

My hostname is headnode1:

GNU nano 1.3.12 File: /etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.1.101 headnode1
192.168.1.111 node1
#::1 localhost6.localdomain6 localhost6


Thank you very much.
Hermann

OdinnBurkni 01-31-2010 10:20 AM

Oscar?
 
Hi there.
I googled OSCAR because I didn't now what you were talking about but I don't think that matters. Your problem is, if I understand you right, that you need to give one of your nic a static IP? On CentOS it's easiest to run setup in CLI there you can alter your network configurations quite easily.
If that doesn't solve your problem we might need more info on your problem.

worm5252 01-31-2010 10:42 AM

HermannPrechtl,

Welcome to LQ. I have no clue what OSCAR is because I have never used it. I do think, like OdinnBurkni, it is irrelevant to what you need to do.

you wanted to see an example of an /etc/hosts file. Here is mine
Code:

jared@Sarah:~$ cat /etc/hosts
127.0.0.1      localhost
10.1.1.20      Sarah

# The following lines are desirable for IPv6 capable hosts
::1    localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
jared@Sarah:~$

All /etc/hosts does is associate an IP address to a hostname or domain. Windows also uses hosts files. they are located in C:\windows\system32\drivers\etc\hosts. Here is how it works.

In the host file you simply list the IP Address then Hostname or domain. Here is an example

Code:

127.0.0.1      localhost
74.125.45.103  google.com
10.1.1.20      Sarah

The above is the IPv4 configuration. At this time thats all you need to worry about. Yes IPv6 is out there, but is not the standard yet and most likely is not needed. In the above code 127.0.0.1 is my localhost (this computer). that is the same for any machine. This computer is named Sarah and I use a static IP of 10.1.1.20 for this machine. if you Ping google.com you will see the returned IP address is 74.125.45.103. Does that make sense on how the file works?

Your next question was on setting up a static IP address on one of your NICs. First you need to identify which NIC is the one needing the Static IP address. In most cases it will be either eth0 or eth1. I will show you how to setup a static IP on eth0. I will list command line commands in ().

1. Become root. (su)
2. make a backup of /etc/sysconfig/network-scripts/ifcfg-eth0 (cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0.bak)
3. Edit /etc/sysconfig/network-scripts/ifcfg-eth0 (nano /etc/sysconfig/network-scripts-ifcfg-eth0)
4. Setup your /etc/sysconfig/network-scripts/ifcfg-eth0 file to look like this
Code:

TYPE=Ethernet
DEVICE=eth0
BOOTPROTO=
IPADDR=192.168.0.45
NETMASK=255.255.255.0
USERCTL=yes
IPV6INIT=no
PEERDNS=yes
ONBOOT=yes

5. Bring Down eth0 and bring it back up (ifdown eth0 && ifup eth0)
6. Check IP address of eth0 (ifconfig eth0)
It should look something like this
Code:

Sarah:/home/jared# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:1f:c6:1d:64:10
          inet addr:10.1.1.20  Bcast:10.1.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21f:c6ff:fe1d:6410/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10071342 errors:0 dropped:144 overruns:0 frame:0
          TX packets:7564817 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:6459863172 (6.0 GiB)  TX bytes:12851860823 (11.9 GiB)
          Interrupt:18


HermannPrechtl 02-02-2010 06:16 AM

Dear All,

Thank you for your tipps. In the meantime I saw that the DHCP-address is also not working. I updated the NIC-Driver and now is my system not more booting.I have a kernel panic here:

Call Trace:

[<c055a6bf>] __driver_attach+0x0/0x6b

[<f893b662>] e1000_probe+0x102/0xfd0 [e1000e]

[<c041eb68>] __wake_up+0x2a/0x3d

[<c05d03ae>] netlink_broadcast+0x242/0x283

[<c055a6bf>] __driver_attach+0x0/0x6b

[<c04f7e95>] pci_device_probe+0x36/0x57

[<c055a612>] driver_probe_device+0x42/0x92

[<c055a703>] __driver_attach+0x44/0x6b

[<c055a00f>] bus_for_each_dev+0x37/0x59

[<c055a55d>] driver_attach+0x11/0x13

[<c055a6bf>] __driver_attach+0x0/0x6b

[<c0559ce7>] bus_add_driver+0x64/0xfd

[<c04f80f3>] __pci_register_driver+0x42/0x8c

[<c043e7f9>] sys_init_module+0x1aed/0x1caa

[<c044eefb>] disable_irq+0x0/0x27

[<c0475eae>] sys_read+0x3c/0x63

[<c0404f17>] syscall_call+0x7/0xb

=======================

Code: ec 10 8b 80 48 01 00 00 05 00 04 00 00 89 44 24 08 89 e8 e8 75 99 ba c7 66 85 c0 75 71 bb 40 00 00 00 8b 54 24 08 b8 00 01 00 00 <8b> 8a e8 2a 00 00 f6 82 21 2a 00 00 02 0f 45 d8 85 c9 74 79 85

EIP: [<f894b697>] _kc_pci_save_state+0x37/0x100 [e1000e] SS:ESP 0068:f37b3d8c

<0>Kernel panic - not syncing: Fatal exception


How can I boot up again the system?

Thanks Hermann


All times are GMT -5. The time now is 04:04 AM.