LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   can't access internet (https://www.linuxquestions.org/questions/linux-newbie-8/cant-access-internet-4175500308/)

geeman75 04-02-2014 08:34 AM

can't access internet
 
Okay Linux newbie here. I set up a server with Ubuntu 12.04 LTS I’m going to use it as a fog server. It has lamp and samba. I have set an static IP address, but unable to access internet, and can’t ping IP address either. I have already tried network restart commands sudo and with out sudo. I'm not sure if that was the right track or not just need to get this up and running.

vbarun2000 04-02-2014 10:44 AM

try to check where your name servers and gateway are correct in

/etc/resolve.conf

schneidz 04-02-2014 11:14 AM

please run this to provide the necessary diag info:
Code:

echo uname: && uname -a -m -p && echo lspci: && lspci && echo lsusb: && lsusb && echo lsmod: && lsmod && echo ifconfig: && ifconfig && echo ifconfig -a: && ifconfig -a && echo iwconfig: && iwconfig && echo resolv.conf: && cat /etc/resolv.conf && echo route: && route -n && echo ping router: && ping -c 1 `route | awk '/default/ {print $2}'` && echo ping dns-server: && ping -c 1 `awk '/nameserver/ {print $2}' /etc/resolv.conf | head -n 1` && echo ping using ip: && ping -c 1 64.235.229.141 && echo ping using dns: && ping -c 1 www.02144.com

geeman75 04-02-2014 11:22 AM

1 Attachment(s)
I am attaching a shot of my ifconfig results to see if that helps to pin point problem.

schneidz 04-02-2014 11:38 AM

i tried pinging that address but it just hangs.

geeman75 04-02-2014 11:44 AM

yeah that's the same problem I am having not sure what to do...

geeman75 04-02-2014 01:47 PM

Does anyone know what I need to do to get it to stop hanging?

EDDY1 04-02-2014 11:43 PM

Have you tried dhclient eth0

evo2 04-02-2014 11:51 PM

Hi,

how did you configure your static IP? Did you edit your /etc/network/interfaces file? What did you set for gateway and netmask?

If you reinitialise that interface do (assuming you really are using /etc/network/interfaces):
Code:

sudo ifdown eth0
sudo ifup eth0

Evo2.

evo2 04-02-2014 11:52 PM

Hi,
Quote:

Originally Posted by EDDY1 (Post 5145709)
Have you tried dhclient eth0

OP said thay are using static IP, not dhpc.
OP: can you confirm?

Evo2.

AwesomeMachine 04-03-2014 02:51 AM

You must use ifconfig to see if the interface is configured. If the network interface has the IP you want, then it's configured. If you can't ping it, a firewall or router is probably blocking the ping. If you have no router between the machines, then you have to use a xover cable. Traceroute might help after you make sure the interface is configured. If you have a default DROP packet filter, you must specifically allow ICMP for ping to pass through.

onebuck 04-03-2014 08:29 AM

Member Response
 
Hi,

I'll add to what other members have suggested. From the 'ifconfig' your IP is assigned to ' Board of Regents of the University System of Georgia'. Do you have the kernel route table setup properly? From the 'cli' do a 'route -n';
Quote:

excerpt from 'man route';
route - show / manipulate the IP routing table

SYNOPSIS
route [-CFvnee]

route [-v] [-A family] add [-net|-host] target [netmask Nm] [gw Gw] [metric N] [mss M] [window W] [irtt I] [reject] [mod] [dyn] [reinstate] [[dev]
If]

route [-v] [-A family] del [-net|-host] target [gw Gw] [netmask Nm] [metric N] [[dev] If]

route [-V] [--version] [-h] [--help]

DESCRIPTION
Route manipulates the kernel's IP routing tables. Its primary use is to set up static routes to specific hosts or networks via an interface after it
has been configured with the ifconfig(8) program.

When the add or del options are used, route modifies the routing tables. Without these options, route displays the current contents of the routing
tables.
Sample route table;
Code:

route -n
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
0.0.0.0        192.168.1.1    0.0.0.0        UG    1      0        0 wlan0
127.0.0.0      0.0.0.0        255.0.0.0      U    0      0        0 lo
192.168.1.0    0.0.0.0        255.255.255.0  U    0      0        0 wlan0

Notice in the above route table that the gateway is '192.168.1.1' for wlan0 with flags 'UG';
Quote:

Flags Possible; flags include
U (route is up)
H (target is a host)
G (use gateway)
R (reinstate route for dynamic routing)
D (dynamically installed by daemon or redirect)
M (modified from routing daemon or redirect)
A (installed by addrconf)
C (cache entry)
! (reject route)
Which means the route is up & to use the gateway address 192.168.1.1 for device wlan0.

Quote:

excerpt from 'man route';

route add default gw mango-gw
adds a default route (which will be used if no other route matches). All packets using this route will be gateway through "mango-gw".

The device which will actually be used for that route depends on how we can reach "mango-gw" - the static route to "mango-gw" will have to be set up before.
To setup your route table then do from the cli' as root:
Code:

route add -net 168.30.166.27  netmask 255.255.255.0 dev eth0

Please note the netmask, I suggest you look at: http://www.aelius.com/njh/subnet_sheet.html to setup proper mask if needed.

Your University IT support admin should give you the correct mask if a change from 255.255.255.0 is necessary.
I assume from the sample output  your mask is assigned by IT already.

then do;

route add default gw mango-gw

mango-gw would be the Georgia gateway IP assigned to you. You can then do a 'route -n' to show the kernel route table to make sure the gateway route is up (U) and that it is correctly assigned (G) flags.

If the eth device has been configured properly and with a valid IP then a valid 'route table a 'ping' to a known good IP should respond properly.


All times are GMT -5. The time now is 07:20 AM.