PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : ifconfig prüft nicht ob IP existiert



LinxNe
05.12.09, 18:24
Hallo zusammen,

ich habe ein Problem.

Ich bin es gewohn, wenn ich unter Windows eine IP setze, die es bereits im Netzwerk gibt, diese nicht setzten kann. (netdome.exe)

Wenn ich das gleiche unter Linux (OpenSUSE 11.2) mache, macht er das einfach.

ifconfig eth0 1.1.1.1

Gibt es eine Mögllichkeit das Linux erst prüft ob es die IP bereits gibt?

Grüße
Franz

heatwalker
05.12.09, 20:21
Nein, ein Linuxsystem geht davon aus das du weisst was du tust und führt deinen Befehl aus. ;)

LinxNe
05.12.09, 22:53
Wie kann ich prüfen ob die IP schon im Netz ist?

Ohne Ping, da dieser ja nicht ohne ip geht.

Grüße
Franz

TheDarkRose
05.12.09, 23:27
wieso nicht mit ping? du weißt ja welche IP du setzen willst, also machst du zuerst einen ping mit dieser IP und wenn du eine antwort bekommst, dann weißt du das diese IP schon im Netz existiert und musst dementsprechend eine andere wählen.

LinxNe
05.12.09, 23:55
soweit ich weiß benötige ich bei ping bereits eine IP Adresse im Netzwerk.

Diese hab ich ja noch nicht.

Ihr könnt mich aber gerne eines besseren belehren

Daher ;-)

TheDarkRose
06.12.09, 00:15
Achso ja du selbst schon. hmm... dann setz dir halt temporär eine andere IP als du vorhast und dann ping die IP die du setzen willst. wenn nix zurückkommst kannst dann die gewünschte IP setzen.

Iluminat23
06.12.09, 01:03
arping

gruß iluminat23

heatwalker
06.12.09, 01:35
Wie kann ich prüfen ob die IP schon im Netz ist?

Ohne Ping, da dieser ja nicht ohne ip geht.

Grüße
Franz

Das Zauberwort lautet "Dokumentation". :cool:

LinxNe
08.12.09, 12:41
Hallo heatwalker,

so was finde persönlich nicht gerade hilfreich.

Kannst du mir nur no sagen wo das in der Doku steht?


Usage:
ifconfig [-a] [-i] [-v] [-s] <interface> [[<AF>] <address>]
[add <address>[/<prefixlen>]]
[del <address>[/<prefixlen>]]
[[-]broadcast [<address>]] [[-]pointopoint [<address>]]
[netmask <address>] [dstaddr <address>] [tunnel <address>]
[outfill <NN>] [keepalive <NN>]
[hw <HW> <address>] [metric <NN>] [mtu <NN>]
[[-]trailers] [[-]arp] [[-]allmulti]
[multicast] [[-]promisc]
[mem_start <NN>] [io_addr <NN>] [irq <NN>] [media <type>]
[txqueuelen <NN>]
[[-]dynamic]
[up|down] ...

<HW>=Hardware Type.
List of possible hardware types:
loop (Local Loopback) slip (Serial Line IP) cslip (VJ Serial Line IP)
slip6 (6-bit Serial Line IP) cslip6 (VJ 6-bit Serial Line IP) adaptive (Adaptive Serial Line IP)
strip (Metricom Starmode IP) ether (Ethernet) tr (16/4 Mbps Token Ring)
tr (16/4 Mbps Token Ring (New)) ax25 (AMPR AX.25) netrom (AMPR NET/ROM)
tunnel (IPIP Tunnel) ppp (Point-to-Point Protocol) arcnet (ARCnet)
dlci (Frame Relay DLCI) frad (Frame Relay Access Device) sit (IPv6-in-IPv4)
fddi (Fiber Distributed Data Interface) hippi (HIPPI) irda (IrLAP)
x25 (generic X.25) infiniband (InfiniBand)
<AF>=Address family. Default: inet
List of possible address families:
unix (UNIX Domain) inet (DARPA Internet) inet6 (IPv6)
ax25 (AMPR AX.25) netrom (AMPR NET/ROM) ipx (Novell IPX)
ddp (Appletalk DDP) x25 (CCITT X.25)


Auch hier habe ich keinen Parameter gefunden der passt.


ifconfig - configure a network interface
Synopsis
ifconfig [interface]
ifconfig interface [aftype] options | address ...
Description
Ifconfig is used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary. After that, it is usually only needed when debugging or when system tuning is needed.

If no arguments are given, ifconfig displays the status of the currently active interfaces. If a single interface argument is given, it displays the status of the given interface only; if a single -a argument is given, it displays the status of all interfaces, even those that are down. Otherwise, it configures an interface.
Address Families
If the first argument after the interface name is recognized as the name of a supported address family, that address family is used for decoding and displaying all protocol addresses. Currently supported address families include inet (TCP/IP, default), inet6 (IPv6), ax25 (AMPR Packet Radio), ddp (Appletalk Phase 2), ipx (Novell IPX) and netrom (AMPR Packet radio). All numbers supplied as parts in IPv4 dotted decimal notation may be decimal, octal, or hexadecimal, as specified in the ISO C standard (that is, a leading 0x or 0X implies hexadecimal; otherwise, a leading '0' implies octal; otherwise, the number is interpreted as decimal). Use of hexamedial and octal numbers is not RFC-compliant and therefore its use is discouraged and may go away.
Options

interface
The name of the interface. This is usually a driver name followed by a unit number, for example eth0 for the first Ethernet interface.
up
This flag causes the interface to be activated. It is implicitly specified if an address is assigned to the interface.
down
This flag causes the driver for this interface to be shut down.
[-]arp
Enable or disable the use of the ARP protocol on this interface.
[-]promisc
Enable or disable the promiscuous mode of the interface. If selected, all packets on the network will be received by the interface.
[-]allmulti
Enable or disable all-multicast mode. If selected, all multicast packets on the network will be received by the interface.
metric N
This parameter sets the interface metric.
mtu N
This parameter sets the Maximum Transfer Unit (MTU) of an interface.
dstaddr addr
Set the remote IP address for a point-to-point link (such as PPP). This keyword is now obsolete; use the pointopoint keyword instead.
netmask addr
Set the IP network mask for this interface. This value defaults to the usual class A, B or C network mask (as derived from the interface IP address), but it can be set to any value.
add addr/prefixlen
Add an IPv6 address to an interface.
del addr/prefixlen
Remove an IPv6 address from an interface.
tunnel aa.bb.cc.dd
Create a new SIT (IPv6-in-IPv4) device, tunnelling to the given destination.
irq addr
Set the interrupt line used by this device. Not all devices can dynamically change their IRQ setting.
io_addr addr
Set the start address in I/O space for this device.
mem_start addr
Set the start address for shared memory used by this device. Only a few devices need this.
media type
Set the physical port or medium type to be used by the device. Not all devices can change this setting, and those that can vary in what values they support. Typical values for type are 10base2 (thin Ethernet), 10baseT (twisted-pair 10Mbps Ethernet), AUI (external transceiver) and so on. The special medium type of auto can be used to tell the driver to auto-sense the media. Again, not all drivers can do this.
[-]broadcast [addr]
If the address argument is given, set the protocol broadcast address for this interface. Otherwise, set (or clear) the IFF_BROADCAST flag for the interface.
[-]pointopoint [addr]
This keyword enables the point-to-point mode of an interface, meaning that it is a direct link between two machines with nobody else listening on it.
If the address argument is also given, set the protocol address of the other side of the link, just like the obsolete dstaddr keyword does. Otherwise, set or clear the IFF_POINTOPOINT flag for the interface.
hw class address
Set the hardware address of this interface, if the device driver supports this operation. The keyword must be followed by the name of the hardware class and the printable ASCII equivalent of the hardware address. Hardware classes currently supported include ether (Ethernet), ax25 (AMPR AX.25), ARCnet and netrom (AMPR NET/ROM).
multicast
Set the multicast flag on the interface. This should not normally be needed as the drivers set the flag correctly themselves.
address
The IP address to be assigned to this interface.
txqueuelen length
Set the length of the transmit queue of the device. It is useful to set this to small values for slower devices with a high latency (modem links, ISDN) to prevent fast bulk transfers from disturbing interactive traffic like telnet too much.

Danke Iluminat23 ich denke genau das wäre eine andere Möglichkeit das ganze zu prüfen.

Werd mir das im laufe der Woche mal anschaun.

Grüße und noch nen schönen Tag
Franz

heatwalker
08.12.09, 12:47
Ich habe mich anscheinend etwas ungenau ausgedrückt.

Mit Dokumentation meine ich ein Datenblatt in dem das Netzwerk
skizziert ist. Sprich z.B. die festvergebenen IP-Adressen aufgeführt sind.

marce
08.12.09, 12:49
Ich glaube, mit "Dokumentation" war in diesem Fall was anderes gemeint...

Eine Meldung im Syslog über Konflikte bei der IP müsstest Du aber auch unter Linux bekommen, wenn Du eine bereits existente IP vergibst...


edit: Mist, zu langsam.

heatwalker
08.12.09, 12:50
edit: Mist, zu langsam.

Mach ja nichts. Passiert mir auch hin und wieder :D

LinxNe
08.12.09, 19:14
Hallo heatwalker,

oh da hab ich das wohl wirklich etwas falsch verstanden.

Ich entschuldige mich nochmals dafür.

Wenn doku da wäre wärs wirkich schon.

Leider ist es auch nicht möglich einen DHCP zu nutzen, da dies in diesem Netzwerk verboten ist. Warum weiß ich nicht. Vorgabe vom Kunden.

arping hat funktioniert danke.

Grüße
Franz

Rain_maker
08.12.09, 20:14
Dokumentation ist wirklich ein gutes Stichwort, in diesem Fall würde ich mir die Datei "/etc/sysconfig/network/config" mal ganz genau ansehen, statt von Hand herumzufummeln.

P.S.

Ifconfig müsste übrigens komplett falsche Baustelle sein, openSUSE verwendet AFAIK seit "Ewigkeiten" das Programm "ip" (Paket iproute2) zur Konfiguration der Netzwerkinterfaces mittels ifup.