kanotix.com

Networking - cannot give pc static IP adress

jack--ren - 26.06.2006, 19:50 Uhr
Titel: cannot give pc static IP adress
After I recently upgraded my kanotix , I want to give my pc a static ip adress
(disable dhcp) but when I do so , I get no internet connection .
It has always worked in the pasted. When I use dhcp , the internetconnection comes up immidiatly, but I need a static IP adress for that pc.
What can be wrong??
ockham23 - 26.06.2006, 20:10 Uhr
Titel:
Check /etc/network/interfaces for correct gateway and /etc/resolv.conf for correct name server entries. You should also configure your router to assign a static IP address to this particular computer; ifconfing will display the MAC address of your NIC.
piper - 26.06.2006, 20:12 Uhr
Titel:
There might be a easier or better way but you can try this

If you are not using a DHCP server or are planning to give tthe system a static IP you need to edit the /etc/networking/interfaces file and add the following lines to it:

iface eth0 inet static
address 192.168.0.4
netmask 255.255.255.0
gateway 192.168.0.1


Replace the IP's in the above example with the correct values for your network

You also need to edit the /etc/resolv.conf file and add the following line to it:

nameserver 192.168.0.1

Make sure you replace the IP address in the example above to the correct one for your network. Now save the changes and activate the network by running the following command:

ifup eth0

Run /sbin/ifconfig or ifconfig to make sure that the network card came up properly.
ockham23 - 26.06.2006, 22:03 Uhr
Titel:
I assume that you're connecting to the Internet through a router. It is advisable to reconfigure the router because this will prevent that you end up with two computers having the same ip address. If you are using a single pc, however, it is not necessary to change the router's settings, and piper's suggestion should work for you.
piper - 26.06.2006, 22:08 Uhr
Titel:
Good point with the router !!

I was not thinking and he didn't mention one, I "try" not to assume (could be dangerous Smilie) anymore, gets me in trouble sometimes Winken
jack--ren - 27.06.2006, 19:15 Uhr
Titel:
piper hat folgendes geschrieben::
There might be a easier or better way but you can try this

If you are not using a DHCP server or are planning to give tthe system a static IP you need to edit the /etc/networking/interfaces file and add the following lines to it:

iface eth0 inet static
address 192.168.0.4
netmask 255.255.255.0
gateway 192.168.0.1


Replace the IP's in the above example with the correct values for your network

You also need to edit the /etc/resolv.conf file and add the following line to it:

nameserver 192.168.0.1

Make sure you replace the IP address in the example above to the correct one for your network. Now save the changes and activate the network by running the following command:

ifup eth0

Run /sbin/ifconfig or ifconfig to make sure that the network card came up properly.


I followed your advise piper and editted /etc/network/interfaces

But there was no etho in /etc/network/interfaces only lan0.
I changed this to eth0 (cause I have a onboard ethernet connection in my pc) and checked the other values.
Then when I did " ifup eth0" I got response , eth0 no such device
and still no internet connection.
How come there is a lan0 device and no etho device?
piper - 27.06.2006, 19:27 Uhr
Titel:
Can you post yours here please also the output of ifconfig

Mine looks like this

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
# automatically added when upgrading
auto lo eth0
iface lo inet loopback

iface eth0 inet dhcp

My ifstate

lo=lo
eth0=eth0
jack--ren - 27.06.2006, 19:48 Uhr
Titel:
here is my /etc/network/interfaces

# /etc/network/interfaces -- configuration file for ifup(Cool, ifdown(Cool

# The loopback interface
# automatically added when upgrading
auto lo eth0 lan0
iface lo inet loopback













iface eth0 inet static
address 10.0.0.153
netmask 255.255.255.0
broadcast 10.0.0.255
gateway 10.0.0.138


iface lan0 inet dhcp



---

ps I now have dhcp enabled to get connection , when I do so , the lines with
lan0 are added to /etc/network/interfaces

and here is ifconfig :

root@jacksbox1:/home/jack# ifconfig
lan0 Link encap:Ethernet HWaddr 00:E0:18:E5:9D:DD
inet addr:10.0.0.154 Bcast:10.0.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1541 errors:0 dropped:0 overruns:0 frame:0
TX packets:3887 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1233747 (1.1 MiB) TX bytes:443487 (433.0 KiB)
Interrupt:5 Base address:0x2e00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:904 errors:0 dropped:0 overruns:0 frame:0
TX packets:904 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:58427 (57.0 KiB) TX bytes:58427 (57.0 KiB)

vmnet1 Link encap:Ethernet HWaddr 00:50:56:C0:00:01
inet addr:172.16.249.1 Bcast:172.16.249.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

vmnet8 Link encap:Ethernet HWaddr 00:50:56:C0:00:08
inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

---
I see there is no eth0 here.
piper - 27.06.2006, 20:31 Uhr
Titel:
Hmm, Did you use netcardconfig ? also Did you hit defaults on knemo ?

Have you tried taking this line out - lan0 in --auto lo eth0 lan0

This is how I did it using Sarge, haven't done it in Kanotix, should be the same, I don't know if this will help or not.

With DHCP

First add lines like this to set up your subnet(s) in dhcpd.conf (kanotix i think is dhclient.conf)

subnet 192.168.0.0 netmask 255.255.0.0.1
option broadcast-address 192.168.255.2;
option routers 192.168.1;

This simply defines some basic network info, add a host section for each machine on your network. You need the MAC address for each network card (ifconfig tells you) example.

host piper.lan.com
hardware ethernet 0:0:c0:5d:bd:65;
fixed-address 192.168.1.55;

Create a clause like this for every machine on your lan with a static IP address
jack--ren - 27.06.2006, 21:34 Uhr
Titel:
taking out the lines with lan0 in /etc/network/interfaces doesn't help.
There seems to be no eth0 device on my pc.
I did netcardconfig from kanotix-menu , never heard of knemo
Tried installing it but apt-get wanted to remove kdelibs-bin so I didn't do it.
Do you have some more suggestions piper?
piper - 27.06.2006, 21:43 Uhr
Titel:
Hmm I thought knemo came up automatically after netcardconfig, I could be mistakin, I am out of options right now, maybe ockham23, kelmo, or kano can be more of help. Sorry Traurig
parintachin - 27.06.2006, 23:35 Uhr
Titel:
eth0 is renamed to lan0 so it will always have the same name.
because if you have more than one networkcard (or wlan,firewire,etc) they could switch names depending on wich is initialized first by udev.
jack--ren - 28.06.2006, 12:45 Uhr
Titel:
parintachin hat folgendes geschrieben::
eth0 is renamed to lan0 so it will always have the same name.
because if you have more than one networkcard (or wlan,firewire,etc) they could switch names depending on wich is initialized first by udev.


But I'm pretty sure that I only have one networkcard.

And it worked with static ip adress before on same pc , but with an earlier version of kanotix.
parintachin - 28.06.2006, 13:44 Uhr
Titel:
it makes no difference how many networkcards you have after you install kanotix (don't know since wich version) it is renamed to lan0 --> so you have to configure lan0
hope i could help
piper - 28.06.2006, 16:32 Uhr
Titel:
I know when I first install Kanotix and go to "network card configuration" a popup pops up asking me to use DHCP, I click yes, then knemo pops up and I click defaults and it automatically goes to eth0, then another popup pops up asking me if I want to start DHCP at startup and I click yes. Not sure if hitting defaults on knemo changes this to eth0 from lan0 or not.




schnorrer - 28.06.2006, 17:28 Uhr
Titel:
It seems that our kollege is running his linuc in a VM.

vmnet8 Link encap:Ethernet HWaddr 00:50:56:C0:00:08

or have I missed that vmnet means working with VPN?
piper - 28.06.2006, 17:53 Uhr
Titel:
Good catch schnorrer !

VMNet is a Wireless Sensor Network (WSN) emulator

I have no experience with this at all Traurig
jack--ren - 28.06.2006, 20:48 Uhr
Titel:
Fixed , I think Parintachin was right en eth0 is just renamed to lan0 so I
gave lan0 and eth0 same values in /etc/network/interfaces ( both static)
and now it seems to work.
Thanks everybody. Sehr glücklich
Alle Zeiten sind GMT + 1 Stunde
PNphpBB2 © 2003-2007