Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ifconfig 2

Status
Not open for further replies.

Scunningham99

Programmer
Sep 20, 2001
815
GB
Hi

have a unix test box, netmasks is set correctly, and name in /etc/hosts

however machine cannot ping.

noticed in netstat -rn there is no devive for hme0().

ifconfig -a returns hme0 with ip 0.0.0.0.

can i type
# ifconfig 10.128.2.26 to set device with ip.
Basically what is the syntax for ifconfig +address!! and will a reboot hold these changes?

Thanks In advance
 
you should do the following:

# ifconfig hme0 unplumb
# ifconfig -a (you will not see hme0 anymore)
# ifconfig hme0 plumb
# ifconfig hme0 IP address broadcast + netmask +

(netmask + sets the network mask as defined in /etc/netmasks, broadcast + sets the broadcast address accordingly)
 
to show all current devices do:
Code:
ifconfig -a

to add a device that exists in the /dev directory do:
Code:
ifconfig <device> plumb

to set the ip address of the device do:
Code:
ifconfig <device> <ip-addr> up

these changes will not stay there after boot ...

to make these changes stay put an entry in /etc/hosts that points at <ip-addr> then create a file called /etc/hostname.<device> and put the name associated with <ip-addr> in that file.

eg on my machine i have /dev/iprb0 so to add this device from scratch i would type
ifconfig iprb0 plumb
ifconfig iprb0 10.10.0.1 netmask 255.255.0.0 up

and in the files i would add
in /etc/hosts:
hosta 10.10.0.1

and in /etc/hostname.iprb0
hosta

i would need to make sure the netmasks were correct as well
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top