Hi,
My wife and I live in a two-storey flat, and we have a small home LAN (100% CentOS 5) with a "classical" configuration:
On the ground floor, there is the telephone jack with the DSL modem router (192.168.1.254). This modem has a mini-switch with two Ethernet jacks to it, and the two are used by:
- the server (192.168.1.1), a "black box" running in a cupboard 24/7 - the wireless AP (192.168.1.253)
Then, on the first floor, everything is connected by wireless, and for the moment, configured statically:
- my desktop PC (192.168.1.2) - my laptop (192.168.1.3) - my wife's laptop (192.168.1.4)
I have an older laptop here, a Fujitsu Siemens Amilo D, that I'd like to use as a simple build box. It's physically installed next to my desktop PC. It doesn't have a wireless card, so I vaguely thought: is it somehow possible to connect this laptop with an Ethernet cable to my desktop PC's unused Ethernet card, and then connect it to the internet? In that case, I wonder if I have to bridge the desktop PC's network interfaces (wlan0 and eth0). That said, I don't even know if the driver for wlan0 (rt61) allows any bridging. Or maybe simply configure a different subnet, but then, what would the network configuration look like on the laptop and on the desktop PC?
Any suggestions for that?
Cheers,
Niki
On Sun, 2008-02-17 at 07:34 +0100, Niki Kovacs wrote:
Hi,
My wife and I live in a two-storey flat, and we have a small home LAN (100% CentOS 5) with a "classical" configuration:
On the ground floor, there is the telephone jack with the DSL modem router (192.168.1.254). This modem has a mini-switch with two Ethernet jacks to it, and the two are used by:
- the server (192.168.1.1), a "black box" running in a cupboard 24/7
- the wireless AP (192.168.1.253)
Then, on the first floor, everything is connected by wireless, and for the moment, configured statically:
- my desktop PC (192.168.1.2)
- my laptop (192.168.1.3)
- my wife's laptop (192.168.1.4)
I have an older laptop here, a Fujitsu Siemens Amilo D, that I'd like to use as a simple build box. It's physically installed next to my desktop PC. It doesn't have a wireless card, so I vaguely thought: is it somehow possible to connect this laptop with an Ethernet cable to my desktop PC's unused Ethernet card, and then connect it to the internet? In that case, I wonder if I have to bridge the desktop PC's network interfaces (wlan0 and eth0). That said, I don't even know if the driver for wlan0 (rt61) allows any bridging. Or maybe simply configure a different subnet, but then, what would the network configuration look like on the laptop and on the desktop PC?
Any suggestions for that?
Unless you really want to spend the time learning the networking configs on CentOS, I'd suggest getting a simple Ethernet to 802.11 bridge. These are commonly called "game adaptors" here in the US.
I have an older laptop here, a Fujitsu Siemens Amilo D, that I'd like to use as a simple build box. It's physically installed next to my desktop PC. It doesn't have a wireless card, so I vaguely thought: is it somehow possible to connect this laptop with an Ethernet cable to my desktop PC's unused Ethernet card, and then connect it to the internet? In that case, I wonder if I have to bridge the desktop PC's network interfaces (wlan0 and eth0). That said, I don't even know if the driver for wlan0 (rt61) allows any bridging. Or maybe simply configure a different subnet, but then, what would the network configuration look like on the laptop and on the desktop PC?
Any suggestions for that?
I have not done bridging on CentOS .. but if you want to route to your laptop you can do the following:
1. Enable IP forwarding by changing "net.ipv4.ip_forward = 0" to "net.ipv4.ip_forward = 1" in /etc/sysctl.conf and running "sysctl -p".
2. Put an IP address in an unused private network on the routing machine's ethernet card.
3. If you want to have a separate routed network, you will need to add a static route on your internet router that sends traffic to the wireless card on your existing network for the wired network segment. If you want to have a network that is masqueraded behind this machine, you do not need the static route, but you will need to add a an iptables rule that says "iptables -t nat -A POSTROUTING -s <private network behind ethernet card> -j MASQUERADE" .. and then run service iptables save to save the changes. This is similar to what you would do if you were setting up a Linux machine to handle your internet connection.
4. You will need to statically configure your laptop client on this private network to use the ethernet card of your routing machine as its default gateway or set up DHCP which instucts it to do the same.
Barry
Niki Kovacs wrote:
Hi,
My wife and I live in a two-storey flat, and we have a small home LAN (100% CentOS 5) with a "classical" configuration:
On the ground floor, there is the telephone jack with the DSL modem router (192.168.1.254). This modem has a mini-switch with two Ethernet jacks to it, and the two are used by:
- the server (192.168.1.1), a "black box" running in a cupboard 24/7
- the wireless AP (192.168.1.253)
Then, on the first floor, everything is connected by wireless, and for the moment, configured statically:
- my desktop PC (192.168.1.2)
- my laptop (192.168.1.3)
- my wife's laptop (192.168.1.4)
I have an older laptop here, a Fujitsu Siemens Amilo D, that I'd like to use as a simple build box. It's physically installed next to my desktop PC. It doesn't have a wireless card, so I vaguely thought: is it somehow possible to connect this laptop with an Ethernet cable to my desktop PC's unused Ethernet card, and then connect it to the internet? In that case, I wonder if I have to bridge the desktop PC's network interfaces (wlan0 and eth0). That said, I don't even know if the driver for wlan0 (rt61) allows any bridging. Or maybe simply configure a different subnet, but then, what would the network configuration look like on the laptop and on the desktop PC?
Any suggestions for that?
Cheers,
Niki
This one qualifies for "There's more than one way to skin a cat". Your final thought is what *I* would do; indeed, what I have done to share a dialup connection before DSL was available here.
1. Leave your current working LAN untouched. 2. Physically connect your desktop PC and the older laptop with a rollover cable. 3. Create a second network on your desktop PC using eth0. 192.168.2.1 would work fine. 4. Add the laptop to the new network, assigning it 192.168.2.2 (or whatever) At this point, you should be able to ping the desktop from the laptop and vice versa. 5. Forward the new network to the old one. On the desktop, as root, enter: # echo 1 > /proc/sys/net/ipv4/ip_forward 6. You should now be able to access the Internet from the hard-wired laptop. 7. To make the change in (5) persist across reboots, etc., edit /etc/sysctl.conf as root and change net.ipv4.ip_forward = 0 --to-- net.ipv4.ip_forward = 1 As far as the rollover cable, I was fortunate enough to stumble upon some RJ-45 reversing couplers so that I never have to worry about the "here it comes" and "there it goes" pairs. Saves wear & tear on crimpers. :-)
Robert a écrit :
- Leave your current working LAN untouched.
- Physically connect your desktop PC and the older laptop with a
rollover cable. 3. Create a second network on your desktop PC using eth0. 192.168.2.1 would work fine. 4. Add the laptop to the new network, assigning it 192.168.2.2 (or whatever) At this point, you should be able to ping the desktop from the laptop and vice versa.
<snip>
First of all, I want to thank everyone here for the contributions.
I spent the best part of yesterday evening and this morning experimenting, and here's a nice solution I found.
Desktop PC: as described above, e. g. leave the current working LAN untouched, then configure the Ethernet card for a 192.168.2.x subnet. Add the laptop to this new subnet, and connect it to the desktop PC with a crosslink cable.
Now, I took advantage of some nicely preconfigured iptables rules in the administration tools:
# system-config-securitylevel-tui
*** Firewall Configuration ***
Security Level (*) Enabled
Customize
Trusted Devices: [*] eth0 [ ] wlan0
MASQUERADE Devices: [*] eth0 [ ] wlan0
***************************************
# service iptables restart
Result:
1) My 192.168.2.2 laptop can connect to the internet, using the desktop PC as gateway.
2) 192.168.2.2 can ping any 192.168.1.x machine transparently.
3) Reversely, any 192.168.1.x machine can ping the 192.168.2.2 laptop.
Conclusion: a huge step for me, a small step for humanity :oD
Cheers,
Niki