• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1136
  • Last Modified:

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:
 Windows 7 network settings that works
But I have problem connecting to internet from OpenSUSE 11.4 with the same settings shown below:

 Linux Network settings IP Linux Network settings DNS Linux Network settings Gateway
Pinging the default gateway 172.0.0.1 returns the below message
> From 172.0.0.233 icmp_seq=2 Destination Host Unreachable.
0
smetechit
Asked:
smetechit
  • 12
  • 8
  • 3
  • +4
1 Solution
 
yadayaCommented:
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

0
 
upanwarCommented:
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
0
 
Sikhumbuzo NtsadaCommented:
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
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
nrip_cheemaCommented:
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

0
 
smetechitAuthor Commented:
upanwar,

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

Try that.
0
 
yadayaCommented:
Remove br0 interface, it could help you.
0
 
rindiCommented:
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.
0
 
upanwarCommented:
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
0
 
nrip_cheemaCommented:
Cant see your gateway configured; can you paste the content of the following file

/etc/sysconfig/network/ifcfg-eth0
0
 
smetechitAuthor Commented:
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
0
 
upanwarCommented:
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.
0
 
Sikhumbuzo NtsadaCommented:
Have tried DHCP on this PC and restarted?
0
 
LinuxNinjaCommented:
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.
0
 
LinuxNinjaCommented:
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....
0
 
smetechitAuthor Commented:
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
0
 
rindiCommented:
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.
0
 
upanwarCommented:
Since the gateway itself is not reachable then how can we ping the google or other IPs.
0
 
rindiCommented:
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).
0
 
upanwarCommented:
No that is not a wireless adapter, IT is a bridge network of eth0, If you will check the Ifconfig file then you will see that MAC address is same for eth0 and br0.

Yeah DHCP is a good idea or as you said that it may be a wlan interface issue then we can down all the interfaces and then bring up the eth0 only and will check.

@ smetechit

execute the below given commands and check whether the gateway is reachable or not.

# ifdown br0

# ifdown eth0

# ifdown wlan0

# ifconfig eth0 172.0.0.X netmask 255.0.0.0 up (here replace X with IP other than  233)

# route add default gw 172.0.0.1
0
 
smetechitAuthor Commented:
Hi upanwar,

The gatway is reachable now, see commands result below:
 snapshot of terminal showing commands and results
But I still can not access internet.
0
 
upanwarCommented:
Now could you please execute the below given command and paste the output.

nslookup yahoo.com

ping yahoo.com
0
 
smetechitAuthor Commented:
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.

0
 
upanwarCommented:
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.
0
 
upanwarCommented:
# ip a
0
 
upanwarCommented:
Please paste the output of

# ip -a

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

# ip a
0
 
smetechitAuthor Commented:
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
0
 
smetechitAuthor Commented:
upanwar,
please let me know what was the problem and how do you solved it.
0
 
upanwarCommented:
Currently I am in the hospital because we are blessed with a baby girl.

I will get back to you after 3-4 hours.
0
 
smetechitAuthor Commented:
my congratulations to you .. take your time
0
 
LinuxNinjaCommented:
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.
0
 
upanwarCommented:
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.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 12
  • 8
  • 3
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now