LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-27-2015, 02:02 AM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
Question on setting up static IP on Ubuntu 14.04 desktop


Hi all,

I encountered problem on setting up static IP without via router

/etc/network/interfaces
Code:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
	address xxx.xxx.xx1 #static_IP
	nameserver xxx.xxx.xxx.xx1
	nameserver xxx.xxx.xxx.xx2
	netmask 255.255.255.xxx
	broadcast xxx.xxx.xxx.xx3
	gateway xxx.xxx.xxx.xx2
Above setting worked for me previously on another box running Ubuntu 12.04

I can ping the static_IP and gateway.

$ ifconfig -a | grep eth
Code:
eth0      Link encap:Ethernet  HWaddr f0:79:59:65:2f:bb
$ sudo lshw -class network
Code:
  *-network               
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: eth0
       version: 09
       serial: f0:79:59:65:2f:bb
       size: 100Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8168f-1_0.0.5 06/18/12 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
       resources: irq:80 ioport:d000(size=256) memory:fa104000-fa104fff memory:fa100000-fa103fff
Please advise. Thanks

Regards
satimis
 
Old 05-27-2015, 02:08 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,132

Rep: Reputation: 7374Reputation: 7374Reputation: 7374Reputation: 7374Reputation: 7374Reputation: 7374Reputation: 7374Reputation: 7374Reputation: 7374Reputation: 7374Reputation: 7374
I would say auto eth0 is not required
 
Old 05-27-2015, 02:47 AM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by pan64 View Post
I would say auto eth0 is not required
Hi,

comment out the line "auto eth0" and reboot PC

$ ifconfig
Code:
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1184 (1.1 KB)  TX bytes:1184 (1.1 KB)
ping static_IP and gate
connect: Network is unreachable

satimis
 
Old 05-27-2015, 03:32 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,132

Rep: Reputation: 7374Reputation: 7374Reputation: 7374Reputation: 7374Reputation: 7374Reputation: 7374Reputation: 7374Reputation: 7374Reputation: 7374Reputation: 7374Reputation: 7374
Code:
iface eth0 inet static
	address xxx.xxx.xx1 #static_IP
	nameserver xxx.xxx.xxx.xx1
	nameserver xxx.xxx.xxx.xx2
	netmask 255.255.255.xxx
	broadcast xxx.xxx.xxx.xx3
	gateway xxx.xxx.xxx.xx2
I assumed there are valid numbers in your file instead of xxx and xx1 and the others. You need to enter here the required values (in case you want static ip)
 
Old 05-27-2015, 03:53 AM   #5
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by pan64 View Post
Code:
iface eth0 inet static
	address xxx.xxx.xx1 #static_IP
	nameserver xxx.xxx.xxx.xx1
	nameserver xxx.xxx.xxx.xx2
	netmask 255.255.255.xxx
	broadcast xxx.xxx.xxx.xx3
	gateway xxx.xxx.xxx.xx2
I assumed there are valid numbers in your file instead of xxx and xx1 and the others. You need to enter here the required values (in case you want static ip)
Sorry. It was a typing mistake. The Static IP and gateway are correct.

/etc/network/interfaces[code]
Code:
iface eth0 inet static
	address 69.xxx.xxx.xx1 #static_IP
	nameserver 203.xxx.xxx.xx1
	nameserver 203.xxx.xxx.xx2
	netmask 255.255.255.xxx
	broadcast 69.xxx.xxx.xx3
	gateway 69.xxx.xxx.xx2
I just contacted ISP to confirm.

I have tried replacing "auto eth0" with "allow-hotplug eth0" but still fails

Edit:
I have tried setting Static IP in many occasions previously without problem. I don't understand why I encountered mistake this time?

Regards
satimis

Last edited by satimis; 05-27-2015 at 03:58 AM.
 
Old 05-27-2015, 07:54 AM   #6
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Hi all,

I found the cause of problem. The network is connected but unable to ping domain. Ping IP address without problem.

$ ping google.com
unknown host google.com

$ ping 74.125.203.139
Code:
64 bytes from 74.125.203.139: icmp_seq=6 ttl=47 time=27.5ms
....
$ ping 68.142.255.16
Code:
64 bytes from 68.142.255.16: icmp_seq=1 ttl=57 time=204 ms
...
$ ping yahoo.com
unknown host yahoo.com

IP addresses of nameserver are correct. I have double checked with ISP.

Additionally I have tried adding them to /etc/resolv.cfg without result.

/etc/network/interfaces
Code:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 61.xxx.xxx.xx1
nameserver 203.xxx.xxx.xxx
nameserver 203.xxx.xxx.xxx
netmask 255.255.255.252
gateway 61.xxx.xxx.xx2
Please help. Thanks

Remark:
The network is without problem via router

Regards
satimis

Last edited by satimis; 05-27-2015 at 07:56 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Setting a static IP on Ubuntu: a beginner's guide LXer Syndicated Linux News 0 02-10-2015 05:12 PM
XFCE desktop question - What and/or where is this setting called? youniqueg33k Linux - Desktop 4 01-08-2015 10:30 AM
setting static IP on linux PCs with no static IP address from internet provider? solvetek Linux - Networking 1 10-22-2011 08:04 AM
Setting up a network in linux (ubuntu 9.10 Desktop) pranavk_uict Linux - Networking 2 12-18-2009 02:48 AM
Setting up Linksys with Ubuntu Desktop PC DeadPenguin Linux - Wireless Networking 10 10-21-2005 09:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration