Slackware This Forum is for the discussion of Slackware Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-14-2008, 08:19 AM
|
#1
|
|
Member
Registered: Jul 2007
Distribution: archlinux, ubuntu, slackware
Posts: 58
Rep:
|
Packet Routing for Connection Sharing
Hi, I was recently discussing this in a separate thread (ndiswrapper issues), though this is now completely irrelevant from that topics, as I'm using tulip now, not a Windows driver.
Basically, I have 2 linux PC's connected with a crossover cable. "xanderbox" (192.168.1.5) is my PC with 2 NIC's that's connected to the router (eth0, gw 192.168.1.1) & to the other PC, "xravtop" (eth1, xravtop's IP is 192.168.1.8).
To route traffic to the correct NIC, I had to manually add an entry into the routing table that routes all packets from 192.168.1.8 to device eth1, and there is no gateway set.
I cannot access the internet from xravtop, as the packets are only being routed to xanderbox (192.168.1.5).
When I attempt to set the gateway for the route I added to 192.168.1.1, this just blows out the connection between the 2 crossover cable connected PC's, so this is obviously not the solution.
If anyone knows how I am able to route packets as to access the internet from the PC connected via crossover cable, it would be greatly appreciated!
I hope that was clear enough, thanks!
|
|
|
|
10-14-2008, 08:50 AM
|
#2
|
|
Member
Registered: Jun 2008
Location: Toronto, Canada
Distribution: Mandriva, RHEL
Posts: 122
Rep:
|
If I understand you correctly, the topology of your net is following:
Code:
Router(IP=192.168.1.1) - some active network device
|
(eth0 = 192.168.1.5)
xanderbox
(eth1 = ?)
|
(eth1 = 192.168.1.8)
xravtop
If so, I haven't seen the eth1's IP. IP address is assumed not to a PC, but to an interface (LAN card).
Please, clearify the topology and show traceroute output.
Last edited by Vit77; 10-14-2008 at 08:53 AM.
|
|
|
|
10-14-2008, 11:33 AM
|
#3
|
|
Member
Registered: Oct 2008
Location: Norway
Distribution: Slackware
Posts: 61
Rep:
|
Can you please post a complete 'ifconfig' and 'ip route' on both boxes?
My first thought is that you have two NICs (eth0 and eth1) on the same subnet.
|
|
|
|
10-14-2008, 12:59 PM
|
#4
|
|
Member
Registered: Jul 2007
Distribution: archlinux, ubuntu, slackware
Posts: 58
Original Poster
Rep:
|
Quote:
Originally Posted by Vit77
If I understand you correctly, the topology of your net is following:
Code:
Router(IP=192.168.1.1) - some active network device
|
(eth0 = 192.168.1.5)
xanderbox
(eth1 = ?)
|
(eth1 = 192.168.1.8)
xravtop
If so, I haven't seen the eth1's IP. IP address is assumed not to a PC, but to an interface (LAN card).
Please, clearify the topology and show traceroute output.
|
I believe this is correct. I am at work right now, or I would have posted the output of those commands. I will post this in 5-6 hours. Thanks!
|
|
|
|
10-14-2008, 04:52 PM
|
#5
|
|
Member
Registered: Jul 2007
Distribution: archlinux, ubuntu, slackware
Posts: 58
Original Poster
Rep:
|
xanderbox:
Code:
bash-3.1# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0A:E6:C5:5C:31
inet addr:192.168.1.6 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20a:e6ff:fec5:5c31/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:54030 errors:0 dropped:0 overruns:0 frame:0
TX packets:52381 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:25573210 (24.3 MiB) TX bytes:10752041 (10.2 MiB)
Interrupt:11 Base address:0xec00
eth1 Link encap:Ethernet HWaddr 00:04:5A:81:B4:40
inet addr:192.168.1.5 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::204:5aff:fe81:b440/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:301955 errors:1 dropped:0 overruns:0 frame:1
TX packets:444877 errors:54 dropped:0 overruns:0 carrier:54
collisions:0 txqueuelen:1000
RX bytes:69298182 (66.0 MiB) TX bytes:512650826 (488.9 MiB)
Interrupt:10 Base address:0xd000
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:16436 Metric:1
RX packets:2157 errors:0 dropped:0 overruns:0 frame:0
TX packets:2157 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:244322 (238.5 KiB) TX bytes:244322 (238.5 KiB)
bash-3.1# ip route
192.168.1.8 dev eth1 scope link
192.168.1.0/24 dev eth1 proto kernel scope link src 192.168.1.5
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.6
127.0.0.0/8 dev lo scope link
default via 192.168.1.1 dev eth0
xravtop:
Code:
eth0 Link encap:Ethernet HWaddr 00:0f:1f:be:3a:68
inet addr:192.168.1.8 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:408399 errors:72 dropped:0 overruns:0 frame:3
TX packets:284924 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:511000237 (487.3 MB) TX bytes:32933501 (31.4 MB)
Interrupt:11
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:42140 errors:0 dropped:0 overruns:0 frame:0
TX packets:42140 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3768860 (3.5 MB) TX bytes:3768860 (3.5 MB)
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.8
169.254.0.0/16 dev eth0 scope link metric 1000
default via 192.168.1.6 dev eth0 metric 100
|
|
|
|
10-15-2008, 01:58 AM
|
#6
|
|
Member
Registered: Oct 2008
Location: Norway
Distribution: Slackware
Posts: 61
Rep:
|
You do indeed have two interfaces on the same subnet. This is really not a good idea unless you plan to bundle traffic to and from the 192.168.1.0/24 subnet. I don't think you intend to do the latter.
The simple way to fix this is to use a different subnet (eg. 192.168.2.0/24) between your computers.
|
|
|
|
10-15-2008, 06:53 AM
|
#7
|
|
Member
Registered: Jun 2008
Location: Toronto, Canada
Distribution: Mandriva, RHEL
Posts: 122
Rep:
|
In general, it seems to be possible. But you have to organize your routing correctly.
On the xravtop:
Code:
ip route add default via 192.168.1.6 dev eth0
On the xanderbox:
Code:
ip route add 192.168.1.8/32 via 192.168.1.6 dev eth0
ip route add default via 192.168.1.1 dev eth1
And check if forwarding on xanderbox is on:
Code:
cat /proc/sys/net/ipv4/ip_forward
If it shows '0', then you've got to enable it:
Code:
echo "1" > /proc/sys/net/ipv4/ip_forward
Or, to make it enabled at the boot time, add the line
Code:
net.ipv4.ip_forward = 1
in /etc/sysctl.conf on xanderbox.
With such addresses, your router must have mask 24 on the inner interface.
If you change the subnet xanderbox-xravtop to, for example, 192.168.2.0/24, you will need to add a new route to your router (192.168.1.1), something like this:
for net 192.168.2.0/24 via 192.168.1.5
Syntax depends on the router's vendor and model.
I hope, it'll help you to tune your net up.
|
|
|
|
10-15-2008, 06:03 PM
|
#8
|
|
Member
Registered: Jul 2007
Distribution: archlinux, ubuntu, slackware
Posts: 58
Original Poster
Rep:
|
I put both PC's (eth1 on my main PC, xanderbox) & eth0 on my laptop onto the 192.168.2.x network. I was using a route like this before: "route add 192.168.1.8 netmask 255.255.255.0 dev eth1", but I'm completely baffled as what to change this to now. Sorry, I don't know much about IP--does the netmask change? I simply changed the route to "route add 192.168.2.8 netmask 255.255.255.0 dev eth1" & I once again could ping xravtop from xanderbox (& vice versa) but I still don't have the internet. There is no default gateway set for this route.
EDIT:
I just saw your post Vit77, thanks for the instruction, I'll try this out  !
Last edited by corteplaneta; 10-15-2008 at 06:05 PM.
|
|
|
|
10-15-2008, 06:25 PM
|
#9
|
|
Member
Registered: Jul 2007
Distribution: archlinux, ubuntu, slackware
Posts: 58
Original Poster
Rep:
|
I believe the only problem was that xanderbox didn't have IP forwarding enabled!
Everything works now (internet connection from laptop)...
Thanks for the help everyone!
|
|
|
|
10-19-2008, 10:12 AM
|
#10
|
|
Member
Registered: Jul 2007
Distribution: archlinux, ubuntu, slackware
Posts: 58
Original Poster
Rep:
|
Ok, sorry to bring back an old post I thought solved, but for some reason everything DOES work, but stops working after some time? If I restart my main desktop PC, everything begins to work correctly again? Does anyone have any idea why this would happen?
|
|
|
|
10-19-2008, 10:26 AM
|
#11
|
|
Senior Member
Registered: Mar 2004
Distribution: Slackware
Posts: 4,282
Rep:
|
Maybe check logs on Desktop PC, especially /var/log/syslog
|
|
|
|
10-20-2008, 10:02 PM
|
#12
|
|
Member
Registered: Jul 2007
Distribution: archlinux, ubuntu, slackware
Posts: 58
Original Poster
Rep:
|
Oct 19 16:18:43 xanderbox last message repeated 24 times
Oct 19 16:18:43 xanderbox kernel: eth1: (40770) System Error occurred (0)
This can't be good!
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:21 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|