Difference between revisions of "office pc network configuration"

From WebHostingNeeds.com
Jump to: navigation, search
 
Line 29: Line 29:
  
 
save and exit the file.
 
save and exit the file.
 +
 +
<pre>
 +
[email protected]:/etc$ cat /etc/network/interfaces
 +
# interfaces(5) file used by ifup(8) and ifdown(8)
 +
auto lo
 +
iface lo inet loopback
 +
# This file describes the network interfaces available on your system
 +
# and how to activate them. For more information, see interfaces(5).
 +
 +
# The loopback network interface
 +
auto lo
 +
iface lo inet loopback
 +
 +
# The primary network interface
 +
auto eth0
 +
 +
# DHCP not needed
 +
# iface eth0 inet dhcp
 +
iface eth0 inet static
 +
address 192.168.0.56
 +
netmask 255.255.255.0
 +
network 192.168.0.1
 +
broadcast 192.168.0.255
 +
gateway 192.168.0.1
 +
dns-nameservers 8.8.8.8
 +
 +
</pre>
  
  

Latest revision as of 07:06, 26 September 2014

Setup Static IP to Ubuntu

Edit $sudo vi /etc/network/interfaces

Find and comment the (default) DHCP entry. Your “interfaces” file should look like this

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0

# DHCP not needed
# iface eth0 inet dhcp
iface eth0 inet static
address 192.168.0.56
netmask 255.255.255.0
network 192.168.0.1
broadcast 192.168.0.255
gateway 192.168.1.1
dns-nameservers 8.8.8.8

save and exit the file.

[email protected]:/etc$ cat /etc/network/interfaces 
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0

# DHCP not needed
# iface eth0 inet dhcp
iface eth0 inet static
address 192.168.0.56
netmask 255.255.255.0
network 192.168.0.1
broadcast 192.168.0.255
gateway 192.168.0.1
dns-nameservers 8.8.8.8
[email protected]:/etc$ 


Then edit /etc/resolv.conf

vi /etc/resolv.conf


Add:
nameserver 192.168.0.1
nameserver 8.8.8.8
search mynetwork.local

Save and exit.

[email protected]:/etc$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
[email protected]:/etc$ 

Edit /etc/hosts

$sudo vi /etc/hosts
Add:
192.168.0.56     flashweb.mynetwork.local      u1404server

Save and exit:

[email protected]:~$ cat /etc/hosts
127.0.0.1	localhost
127.0.1.1	flashwebhost-H81M-S
192.168.0.56     u1404server.mynetwork.local      u1404server

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
[email protected]:~$ 


Then restart network