Setup network using terminal

Asked by Jay Sidd

The problem is like this:
It is needed to up a network connection without GUI applet on a PC with following parameters:

IP 192.168.1.200
Mask 255.255.255.0
Gateway 192.168.1.1
DNS 192.168.1.1

So, using terminal, I’ve done so:

1. ifconfig 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255 up
2. route add default gw 192.168.1.1 eth0

3.sudo gedit /etc/resolv.conf
   Then typed in following: nameserver 192.168.1.1

Yet, there is no connection to internet. I’ve set same network parameters using GUI on the other ubuntu machine and it works fine.
 “ifconfig eth0” on both PCs seems to show the same results.

What have I missed?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu gnome-nettool Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
FactTech (launchpad-facttechnologies) said :
#1

The ifconfig command you listed in your problem description seems malformed -- it should reference an interface (e.g. "eth0").

Also, if both PCs are on the network, they should not be configured with the same IP address, which is implied by your statement that "both PCs seems to show the same results." If necessary, change the IP address assignment for one machine so that they are not in conflict.

You may find it helpful to configure one machine with DHCP services to allow automatic network configuration. Is this a possibility?

Revision history for this message
Jay Sidd (ya-obako) said :
#2

I probably misspoke: those PCs aren't on the same network - I used 2nd one just to check if there's a connection to internet at all with this IP configuration. Yet, eth0 in the Ifconfig line might help, thanks. (Devil's in the details, so it seems)

Can you help with this problem?

Provide an answer of your own, or ask Jay Sidd for more information if necessary.

To post a message you must log in.