Link to home
Start Free TrialLog in
Avatar of ffan
ffan

asked on

how to setup/config network

I have a new SUN Ultra5 box

I need to setup TCP/IP network
I have got IP, netmask, broadcast and gateway addresses

I don't know how to set tcp/ip up using commands
when I excute some ifconfig and netstat commands, I have the following outputs:


# ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
hme0: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
        inet 10.251.11.109 netmask ffffff00 broadcast 10.251.15.255
        ether 8:0:20:ff:e2:52


# netstat -rn

Routing Table: IPv4
  Destination           Gateway           Flags  Ref   Use   Interface
-------------------- -------------------- ----- ----- ------ ---------
127.0.0.1            127.0.0.1             UH       2     13  lo0
#

the interface to be setup is hme0

when I tried

route add default gateway 10.251.11.1

had error

gateway: bad value

I am sure that the physical network connection is OK as I swap the cable with the other machine and the other machine works OK

Can someone help please?

I need to use commands not GUI
Avatar of samri
samri
Flag of Malaysia image

For command line,

# route add default <ip of default router/gateway> 1
 If you are not sure what is your default router/gateway, you might want to check with your network guy.

And if you want to make it permanent there are a few files that you need to look at.

/etc/hosts
/etc/hosname.hme0
/etc/defaultrouter
/etc/netmask

in /etc/hosts

10.251.11.109           yourhostname

and in /etc/hostname.hme0, put
yourhostname

The entry in /etc/hostname.hme0 must correspond with <yourhostname> in /etc/hosts

in /etc/defaultrouter key in the ip address of your defaultrouter.  For example
10.251.11.254

in /etc/netmasks
add a line :
<you network number>     <your netmasks>
10.251.11.0             255.255.255.0

And then reboot your machine.

good luck
Avatar of besky
besky

What samri writes is correct except for the netmasks
file.
In this file you shoild enter the base network and the mask you you want to put on that network.

In your case the base network is a class A network (10.0.0.0).
This is maybe not the best choice for a small network, better to use one of 192.168.0 - 192.168.255 (reserverd for private networks not on the net or hidden behind NAT gateway.

Anyway, put 10.0.0.0  255.255.255 in the netmasks file
ASKER CERTIFIED SOLUTION
Avatar of yuzh
yuzh

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added lately, so it's time to clean up this Topic Area.
I will leave a recommendation for this question in the Cleanup topic area as follows:

- Answered by yuzh

Please leave any comments here within the next 7 days

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

tfewster
Cleanup Volunteer
Finalized as proposed

modulo

Community Support Moderator
Experts Exchange