English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I need a command which will enable me to enter ip address, subnet mask gateway and dns so that I can access internet

2006-08-18 22:21:46 · 1 answers · asked by nakei 1 in Computers & Internet Computer Networking

1 answers

Hi nakei,
You can typically use the "ifconfig" command to accomplish this. See the man page "man ifconfig" for full details. For example, first do an "ifconfig -a" to see the list of interfaces and their existing configurations. Suppose your interface is called "eth0" then your command would look something like "ifconfig eth0 192.168.1.123 netmask 255.255.255.0 broadcast 192.168.1.255 up". You substitute your own IP subnet/address. Then follow this with another ifconfig -a to see and confirm the results.

For a default route you would typically use the route command, such as "route add default 192.168.1.1" for example, you fill in your default gateway IP address. On some systems, you can also create/edit the /etc/defaultrouter file and put the IP address in there so it will persist across reboots.

Like in Windows, use the "netstat -nr" command to see your routing table.

For DNS, you typically edit the /etc/resolv.conf file and put in the line "nameserver 10.20.30.40" and substitute your own name server's IP address instead of 10.20.30.40.

You may need to do some googling for your specific version of Unix/Linux along with these commands, for instance, google search on Solaris+configure+nameserver or Linux+configure+default+route, etc... Hope this helps.

2006-08-20 16:16:04 · answer #1 · answered by networkmaster 5 · 0 0

fedest.com, questions and answers