Link to home
Start Free TrialLog in
Avatar of smetechit
smetechit

asked on

Linux Network settings

Hello,

In my work network, I have dual system laptop (Windows 7 and OpenSUSE 11.4)
I can connect to internet from Windows 7 using the below settings:
 User generated image
But I have problem connecting to internet from OpenSUSE 11.4 with the same settings shown below:

 User generated image User generated image User generated image
Pinging the default gateway 172.0.0.1 returns the below message
> From 172.0.0.233 icmp_seq=2 Destination Host Unreachable.
Avatar of yadaya
yadaya

First you need test is your network works ok.
Post output of these commands please.

ping 172.0.0.1

ping 10.0.0.50

ping www.com

ifconfig 

netstat -nr

Open in new window

Could you please show us output of below given commands from linux.

# ifconfig -a

# cat /etc/resolve.conf

# route -n

and also run the below given command in windows machine and paste the output.

ipconfig /all
You can select DHCP and get an IP address, then ping other PCs on the network, if all work use those setting as your static IP settings.

You can check your IP by typing:
ifonfig

You can check the default gateway by typing:
route -n
If you are not able to ping the gateway, its probably the IP/subnet mask / or NIC card

/etc/sysconfig/network/ifcfg-eth0

above file has all the networking settings except for DNS.  Cross check the above file for you ip and dns and default gateway.

DNS settings are in /etc/resolv.conf

Avatar of smetechit

ASKER

upanwar,

attached are results of requested commands from Linux and Windows
ifconfig-linux.txt
cat-resolv.conf.txt
route-linux.txt
ipconfig-windows.txt
inet addr:172.0.1.59 >> inet addr:172.0.0.59

Try that.
Remove br0 interface, it could help you.
Avatar of rindi
If you can ping IP's (not domain names) on the internet, like 74.125.79.147 (google.com), then you probably have a problem the name servers. Try adding the 10.0.0.0 subnet to the routing table.
I have seen that you are not able to ping the gateway itself and network settings on both the hosts are looks fine. But It might have a issue of your bridge interface so could you please execute the below given command and then try to ping the gateway.

# ifconfig br0 172.0.0.59 netmask 255.0.0.0 up

# ping 172.0.0.1

If you still face the same issue, then give us output of below given command.

# ethtool eth0
Cant see your gateway configured; can you paste the content of the following file

/etc/sysconfig/network/ifcfg-eth0
I run  ifconfig br0 172.0.0.59 netmask 255.0.0.0 up
without any message output

below is the result of pining 172.0.0.1

PING 172.0.0.1 (172.0.0.1) 56(84) bytes of data.
From 172.0.0.233 icmp_seq=3 Destination Host Unreachable
From 172.0.0.233 icmp_seq=4 Destination Host Unreachable
From 172.0.0.233 icmp_seq=7 Destination Host Unreachable
From 172.0.0.233 icmp_seq=8 Destination Host Unreachable

Attached is the output of ethtool eth0
ethtool-Linux.txt
ethtoll's output looks fine to me.

Could you please execute below given command and try to ping the gateway.

# ip route delete default
# ip route add default via 172.0.0.1 src 172.0.0.233

If you still face the same issue then try to get down the bridge interface br0 and then try again.

# ifconfig br0 down

and ping the gateway.
Have tried DHCP on this PC and restarted?
Are you running IPTables?

# iptables -F

This will flush them.

Previous suggestion of bringing down the br0 interface I agree with, however your default route already shows eth0, so I don't see that as an issue.

# arp -an

See if this is populated with the arp traffic from other devices on your network. See if you see an entry for your gateway IP in the list. You should at least see your own IP and MAC in the list.

If you do see the gateway IP and MAC in the list, try:

# arping 172.0.0.1

Similar to PING, but uses ARP packets instead of ICMP. Do you get a reply?
If all of the above fails, my last resort is a NIC driver issue in SUSE, but with the TX and RX counters incrementing in your ifconfig output, I don't think that's the issue, either.

Keep in mind that other IP addresses on the internet begin with 172, so you won't be able to access those. Reserved addresses per RFC1918 are 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16. This would give you 172.16.0.0 through 172.31.255.255 as private addresses. Just a word of advice.
Just read your ipconfig output... you're not running SUSE inside VirtualBox, are you? If so, you're using the wrong network config for this VM....
I am attaching the file /etc/sysconfig/network/ifcfg-eth0

For upanwar,
I run ip route delete default
then ip route add default via 172.0.0.1 src 172.0.0.233
both commands have no output
ping 172.0.0.1 is still not working (Destination Host Unreachable).
then I run  ifconfig br0 down
and pinging 172.0.0.1 still replies Destination Host Unreachable.


ifcfg-eth0
The ipconfig output is from windows the windows system, not the Linux system.

Have you tried adding the 10.0.0.x subnet to the routing table, and have you tried pinging the google IP I posted earlier? Also ignore the br0 interface for the moment, eth0 is the important one.
Since the gateway itself is not reachable then how can we ping the google or other IPs.
If I'm not mistaken he was trying to get to the gateway using br0, and that is probably the wireless adapter which probably hasn't been associated with a wireless router ot access point yet. That's why I want him to forget that adapter for the moment, if possible turn the wireless NIC off using the switch or function keys or whatever is available on that PC so it doesn't add itself to the problem.

In my opinion the DNS servers can't be reached because they are on a different network than the actual NIC is on.

Personally I'd support the other idea of using DHCP, and if a static IP is needed reserve those IP's directly on the DHCP server, as that makes management of those static IP's much more simple since it is centrally organized. But for that you will of course have to be in charge of the DHCP server (or get the IT dep to reserve those addresses for your MAC address).
ASKER CERTIFIED SOLUTION
Avatar of upanwar
upanwar
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi upanwar,

The gatway is reachable now, see commands result below:
 User generated image
But I still can not access internet.
Now could you please execute the below given command and paste the output.

nslookup yahoo.com

ping yahoo.com
upanwar .. the problem solved and I can browse internet now. It seems I have to run route add default gw 172.0.0.1 after running ifconfig eth0 172.0.0.233 netmask 255.0.0.0 up

Thanks for all of you

1) why you asked me to change IP other than 233?
2) have I to run these commands every time I restart Linux?
3) regarding question points, I will assign all of 500 points to upanwar only unless upanwar gives another suggestion.

route add default gw 172.0.0.1 after executing it. It sets the route to take your request out.

1. I have to change the ip because I was suspecting a network conflict.

2. You no need to execute these commands everytime after reboot, for the time being you can put them in rc.local.

After reboot fist execute the below given command and paste the output so that we can get a permanent fix.
# ip a
Please paste the output of

# ip -a

after reboot your box so that we can get a permanent fix of your problem.
sorry its.

# ip a
where can I find rc.local?

I am attached results of ip -a before and after running the below commands

# ifdown br0
# ifdown eth0
# ifdown wlan0
# ifconfig eth0 172.0.0.233 netmask 255.0.0.0 up
# route add default gw 172.0.0.1

ipa1.txt
ipa2.txt
upanwar,
please let me know what was the problem and how do you solved it.
Currently I am in the hospital because we are blessed with a baby girl.

I will get back to you after 3-4 hours.
my congratulations to you .. take your time
The answer is not to modify the rc.local.

The startup scripts should bring up the interfaces you need, assign the IPs, then set the routes. Having to modify the rc.local is a kludge.

In SUSE, if you make the correct entries in the GUI, the IPs and routes are properly set when the interface is brought up. The steps you have taken up to this point lead me to believe that the config files are simply wrong, so let's look at fixing them.

Are you using yast to configure the network, or are you modifying the config files by hand?
Either way, posting the configs so we can look for errors, and disabling the interfaces you aren't using, should resolve your issue. Nothing so far has indicated an issue other than misconfiguration.
Thanks for your congrates.

I was sure that one of the interface is creating problem, so I have asked you to get down all the interfaces.

# ifdown br0
# ifdown eth0
# ifdown wlan0

and then I have asked you to execute command to make the eth0 up only and set the route by.

# ifconfig eth0 172.0.0.233 netmask 255.0.0.0 up
# route add default gw 172.0.0.1

Earlier we have tried so many ways to route the traffic from eth0 and we have execute last 2 commands without getting down all the interfaces but no luck, so this time I have asked you to get all the interfaces down.

Now the problem could be with either the bridge interface or the wi-fi interface, most probably yhe culprit is br0, so execute the below given commands to remove that interface and then reboot your system and check your internet without executing all five commands. It should work.

# brctl delif br0 eth0

# brctl delbr br0

If still nothing works then switch-off the wi-fi interface, you should have a switch on your laptop to make it on/off. Everything would be fine.

@LinuxNinja: Thanks for Heads up, I forgot that Its a Suse Box.

smetechit: Since Its a Suse Linux so its dont have rc.local its have /etc/init.d/boot.local for the same.