Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Networking & Security
  • Search

Home network setup help, 2 routers 3 PCs

Having problems getting connected to the internet or running a server? Wondering about securing your box? Ask here.
Post Reply
Advanced search
6 posts • Page 1 of 1
Author
Message
Malcolm
n00b
n00b
User avatar
Posts: 59
Joined: Thu Jul 11, 2002 3:58 am
Location: Ontario, Canada
Contact:
Contact Malcolm
Website

Home network setup help, 2 routers 3 PCs

  • Quote

Post by Malcolm » Tue Sep 21, 2004 2:39 pm

This is what I'd like to do, but have little idea how to do it.

Currently I have 2 PCs and 1 LCD dead laptop. I'm running the laptop as a Gentoo server, one PC is the family PC (Windows) and the other is my Gentoo/Windows workstation.

What I'd like to do is have a normal Ethernet connection between the family PC (Windows based) and the router, a wireless connection between my wireless router and the laptop, and have my workstation connected to the laptops NIC card (I still need to buy a cross-over cable).

The wireless router controls the PPPoE connection.

Any ideas how I can do this? Because my description above is kinda crappy heres a diagram:

Code: Select all

|--------------|
| DSL Modem    |
|--------------|
       | (RJ-45)
|-----------------|
| Wireless router |
|-----------------|
     |        |
     |         \
     | (RJ-45)  \ (802.11b)
|----------|    |---------------|
| Ethernet |    | Laptop Server |
| PC (NIC) |    | (wireless)    |
|----------|    |---------------|
                       | (RJ-45)
                |------------------|
                | Ethernet PC (NIC)|
                |------------------|
So the laptop would be running a dhcp server and routing, as well as forwarding(?).

I did something like this 2 or 3 years ago in college with Zebra but I dumped the notes, I wouldn't mind some direction :)
Top
marvin
n00b
n00b
Posts: 58
Joined: Wed Jan 29, 2003 10:12 pm

  • Quote

Post by marvin » Thu Sep 23, 2004 9:55 am

I would just give the PC behind the laptop a static ip (e.g. 192.168.0.17), because I think it will be easier to setup routing that way.
Set the laptop as gateway on the PC behind it. Then your /etc/conf.d/net (on the laptop) can look like this:

Code: Select all

# to ethernet pc
iface_eth0="192.168.0.16 broadcast 192.168.0.255 netmask 255.255.255.254"
# wlan
iface_eth1="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

# For setting the default gateway
gateway="eth1/192.168.0.1"
This should make a subnet of 2 ips inside the local subnet for the ethernet PC and the laptop and set up correct routing.
Then enable forwarding by adding:

Code: Select all

echo "1" > /proc/sys/net/ipv4/conf/all/forwarding
to /etc/conf.d/local.start

This is a bit of a hack and might only work if the entries in the routing table appear in the correct order:

Code: Select all

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.16     0.0.0.0         255.255.255.254   U     0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo
0.0.0.0         192.168.0.1    0.0.0.0         UG    0      0        0 eth1
If this doesn't work you might give the the ethernet PC and ethernet card of your laptop just another subnet (192.168.1.x). But that may cause problems if your wireless router supports only one subnet. Then you have to make NAT on your laptop such that the wireless router sees only ips from 192.168.0.x.

In all cases dhcp should also work if you set the right ip range.
Join the adopt an unanswered post initiative today!
Top
Malcolm
n00b
n00b
User avatar
Posts: 59
Joined: Thu Jul 11, 2002 3:58 am
Location: Ontario, Canada
Contact:
Contact Malcolm
Website

  • Quote

Post by Malcolm » Mon Sep 27, 2004 2:37 am

I've almost got everything going alright, I'm just having problems getting both PCs to talk to each other.

Dsl modem is connected to my hardware router via the uplink port.

My router has a static ip of 192.168.2.1 and is running a dhcp service.

The family PC is connected to the routers #1 port, with 192.168.2.100.

My laptop has a wireless connection with a static IP set to 192.168.2.120.

My laptop is running dhcpd, iptables with forwarding and dnsmasq.

My laptop has a static IP of 192.168.0.1 on the ethernet port.

My dual boot system is connected to the laptops ethernet port and browsing the web fine, usually assigned the address 192.168.0.105.

How can i get both PCs to talk to each other? Its not really nessessary but it would help me out quite a bit.

thanks for any help :)
Top
servermonk
Apprentice
Apprentice
User avatar
Posts: 182
Joined: Fri Nov 07, 2003 5:38 am
Location: MI
Contact:
Contact servermonk
Website

  • Quote

Post by servermonk » Mon Sep 27, 2004 2:52 am

That depends on what you mena by "talk to eachother". Are they unreachable from their respective networks? You could try changing the netmask so they're on the same 'network'.
Gentoo makes me wanna shoop.
Top
Malcolm
n00b
n00b
User avatar
Posts: 59
Joined: Thu Jul 11, 2002 3:58 am
Location: Ontario, Canada
Contact:
Contact Malcolm
Website

  • Quote

Post by Malcolm » Tue Sep 28, 2004 2:12 am

servermonk wrote:That depends on what you mena by "talk to eachother". Are they unreachable from their respective networks? You could try changing the netmask so they're on the same 'network'.
talk to eachother as in nfs/samba shares ;)

I'll try adjusting the addresses so they overlap, but I thought that would break something...
Top
Malcolm
n00b
n00b
User avatar
Posts: 59
Joined: Thu Jul 11, 2002 3:58 am
Location: Ontario, Canada
Contact:
Contact Malcolm
Website

  • Quote

Post by Malcolm » Sat Oct 02, 2004 10:37 pm

Everything's up n' running, thanks :)
Top
Post Reply

6 posts • Page 1 of 1

Return to “Networking & Security”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic