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 10-24-2006, 11:09 PM   #1
Andrea_44
LQ Newbie
 
Registered: Oct 2006
Posts: 4

Rep: Reputation: 0
inet<---eth1[LinuxBox_1]eth0<---e0[LinuxBox_2] : LinuxBox_2 hv no inet connection?


Hi,

This is my network topology:
Internet----eth1[LinuxBox_1]eth0----eth0[LinuxBox_2]

Issue:
What other routes do I need to add to the routing table in order for LinuxBox_2 to have internet connection?(LinuxBox_1 have internet connection)

Destination Unreachable when LinuxBox_2 try to ping the gateway in LinuxBox_1(172.19.96.1) and LinuxBox_1 eth1(172.19.96.127).

LinuxBox_1 - Kernel IP routing table(route -n)
Destination Gateway Genmask Flags Metric Ref Use Iface
172.19.96.0 0.0.0.0 255.255.254.0 U 0 0 0 eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 172.19.96.1 0.0.0.0 UG 0 0 0 eth1

LinuxBox_1 - eth0 : 169.254.4.217
LinuxBox_1 - eth1 : 172.19.97.127

LinuxBox_2 - Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 169.254.4.218 0.0.0.0 UG 0 0 0 eth1
LinuxBox_2 - eth0 : 169.254.4.218


Any help would be great. Thanks,

Andrea
 
Old 10-24-2006, 11:23 PM   #2
alienux
Member
 
Registered: Sep 2006
Location: Dayton, Ohio
Distribution: Slackware 12, Fedora Core, PCLinuxOS
Posts: 194

Rep: Reputation: 30
Linux box 2 needs to either have Linux box 1's 169.x.x.x address as its default gateway or it needs a static route for 172.19.96.0 via 169.254.4.217. You also need IP forwarding enabled on box 1 if it isn't already.
 
Old 10-24-2006, 11:54 PM   #3
Andrea_44
LQ Newbie
 
Registered: Oct 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Internet<---eth1[LinuxBox_1]eth0<---eth0[LinuxBox_2]

LinuxBox_2 - eth0 : 169.254.4.218
LinuxBox_2 - gw : 169.254.4.217

LinuxBox_1 - eth0 : 169.254.4.217
LinuxBox_1 - eth1 : 172.19.97.127
LinuxBox_1 - gw : 172.19.96.1

I have change the LinuxBox_2 default gateway to 169.254.4.217 (LinuxBox_1 eth0)

LinuxBox_2 - Kernel IP routing table:
Destination__Gateway________Genmask______Flags__Iface
169.254.0.0__0.0.0.0________255.255.0.0__U______eth0
0.0.0.0______169.254.4.217__0.0.0.0______UG______eth0

On LinuxBox_2 I am unable to ping the LinuxBox_1 gateway (172.19.96.1) and LinuxBox_1 eth1 (172.19.97.127).
"From 169.254.4.217 Dest Host Unreachable".

But I could reach LB1 eth0 (169.254.4.217)

******
Btw, I have also tried adding the static route to 172.19.96.0 via 169.254.4.217

Destination__Gateway________Genmask________Flags__Iface
172.19.96.0__169.254.4.217__255.255.254.0__UG_____eth0
169.254.0.0__0.0.0.0________255.255.0.0____U______eth0
0.0.0.0______169.254.4.217__0.0.0.0________UG_____eth0
******

Many thx,
Andrea
 
Old 10-25-2006, 12:08 PM   #4
alienux
Member
 
Registered: Sep 2006
Location: Dayton, Ohio
Distribution: Slackware 12, Fedora Core, PCLinuxOS
Posts: 194

Rep: Reputation: 30
Do you have IP Forwarding enabled on box 1? Also, are you running a firewall on box 1 that would block ICMP requests?

I also noticed that you now listed your gateway for box 1 as being on the 172.19.96.0 network, but the NIC on box 1 as being on the 172.19.97.0 network. These two addresses should be on the same subnet.
 
Old 10-25-2006, 02:13 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 26,753

Rep: Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318Reputation: 6318
169.254.0.0 are special automatic IP addresses. They are assigned when the DHCP client can not talk to the server.

eth0 on the #1 box should be assigned a private static IP address like 192.168.0. The #2 box can either be assigned a static IP address like 192.168.0.2) are configured using DHCP if the server is enabled on #1. Each computer network adapter must have a unique IP address on the same network. If using a static IP address on the client you will need to add the DNS nameserver info into the /etc/resolv.conf file.
 
Old 10-25-2006, 08:18 PM   #6
Andrea_44
LQ Newbie
 
Registered: Oct 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Quote:
Do you have IP Forwarding enabled on box 1?
cat /proc/sys/net/ipv4/ip_forward return 1

Quote:
Also, are you running a firewall on box 1 that would block ICMP requests?
I tried out this command earlier on, not too sure what effect this would has on my machine:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
and
iptables -L -nv return nth interesting:
Chain INPUT (policy ACCEPT 32179 packets, 6898K bytes)
pkts bytes target prot opt in out source destination

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 7569 packets, 1657K bytes)
pkts bytes target prot opt in out source destination

Quote:
I also noticed that you now listed your gateway for box 1 as being on the 172.19.96.0 network, but the NIC on box 1 as being on the 172.19.97.0 network. These two addresses should be on the same subnet.
Yea, it looks like eth1 172.19.97.127 and the gw 172.19.96.1 is on 2 different subnets, the subnet mask is 255.255.254.0. But those addresses are what I got from ifconfig and route -n, should be correct.

Quote:
eth0 on the #1 box should be assigned a private static IP address like 192.168.0. The #2 box can either be assigned a static IP address like 192.168.0.2) are configured using DHCP if the server is enabled on #1.
I'm not sure how to enable a DHCP server on box1.

Quote:
If using a static IP address on the client you will need to add the DNS nameserver info into the /etc/resolv.conf file.
I shall try out the static IP address on the client if I can't enable DHCP on the server.

Thax for the help~

Andrea

****FYI****
$ ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:46:6A:0C:B0
inet addr:169.254.4.217 Bcast:169.254.255.255 Mask:255.255.0.0
inet6 addr: fe80::a00:46ff:fe6a:cb0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:16695 errors:0 dropped:0 overruns:0 frame:0
TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1001700 (978.2 KiB) TX bytes:4716 (4.6 KiB)

eth1 Link encap:Ethernet HWaddr 00:02:2D:6D:C4:65
inet addr:172.19.97.127 Bcast:172.19.97.255 Mask:255.255.254.0
inet6 addr: fe80::202:2dff:fe6d:c465/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:63303 errors:0 dropped:0 overruns:0 frame:0
TX packets:11118 errors:87 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10356019 (9.8 MiB) TX bytes:2813324 (2.6 MiB)
Interrupt:9 Base address:0x3040
 
  


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
Problem with getting up the inet connection. velder Mandriva 8 09-10-2004 04:23 PM
Connection to Inet problems control_x Linux - Networking 3 09-06-2004 08:01 PM
trying to share an inet connection with XP class_struggle Linux - Newbie 6 08-30-2004 10:28 AM
eth0 device defaulting to inet6 rather than inet? schurt Fedora 1 06-11-2004 07:18 AM
Inet connection times out zzZoiDzz Linux - Networking 1 01-19-2004 12:33 AM

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

All times are GMT -5. The time now is 02:27 PM.

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