Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Linux as a GATEWAY ---> HELP!

Posted on 2002-07-03
8
Medium Priority
?
235 Views
Last Modified: 2013-12-15
The scenario is the following...

I have a p133 notebook running linux mandrake 7.1 with not gui installed so i am using the console for everything as the gui is too slow on the notebook. This notebook is connected to a HUB. My ADSL modem is connected to the same HUB. I have another computer in another room which is connected to the hub as well (there are now 3 things connected) and it has MS WINXP on it. I want the linux notebook to connect to my ADSL connection (i know the username and pswd and the DNS search suffix) and once connected, it must share the connection so that other computers on the network can use the internet too. Tell me how to configure the linux box and the windows xp box and i will award the points. By the way the work group on the windows computers is MSHOME.

Thank - you...

Tim.
0
Comment
Question by:timster692001
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 17

Expert Comment

by:psimation
ID: 7129122
Use netconf to have the Linuxbox receive the correct IP and subnet. Make sure you can ping to and from the pc's.

Now, make sure your linux box can connect via adsl on it's own.

When you have that done, add the linux box's IP to the windows box(es) as the gateway, then on the Linux box you need to masquerade the linux box IP, I use iptables for that, you might need to read up on ipchains.
For iptables(given that it is compiled on the Linux box...)

# echo "1" > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE

just replace ppp0 with the appropriate interface name of the adsl ( probably eth1)
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7129469
even all 3 boxes are on the same hub, you need to different IP subnets for it:
  1. notebook and ADSL
  2. notebook and Windoze
'cause you have only one interface in your notebook, you need to add a virtual one, like:
  ifconfig eth0:1 10.10.10.1 netmask 255.255.255.0 up
wher eth0 has IP 192.168.1.1
your ADSL box might have the IP 192.168.1.2
your Windoze box might have IP 10.10.10.2

no you can NAT all using:
   iptables -t nat -A POSTROUTING -o eth0 -s 10.10.10.0/24 -j MASQUERADE
0
 
LVL 40

Accepted Solution

by:
jlevie earned 300 total points
ID: 7130253
I'll have to differ with ahoffman on this. I've found a firewall/gateway to be problematical if it doesn't have two physical interfaces. And everything I've read on IPchains/IPtables says not to attempt a firewall/gateway with only one interface. Furthermore, I believe you'll have problems with everything connected to a single hub, and you've certainly compromised the security afforded by a firewall with inside and outside connections on a single "wire".

Get another PCMCIA NIC for the laptop. Connect one NIC to the ADSL modem and the other to the hub and set up IPchains or IPtables as desired. You'll be using an RFC1918 private network on the inside and will need to configure the xp box accordingly.
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 7131119
jlevie, I'm aware of the security problems when there is only one interface. My iptables can handle virtual interfaces (as long as there are no MAC rules), I'm not shure about ipchains.
Another NIC would of corse be the better solution.
0
 

Author Comment

by:timster692001
ID: 7133797
That would be easy to add a nic, however the notebook does not have a USB port and i am not going to spend $100 on a new PCMCIA lan card. So i will have to network them as i specified in the first place. Please expand on some of your answers, they are difficult to follow as i am not as experienced as you people.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7133808
step by step:
  1. # setup physical and virtual interface/IP on notebook:
     ifconfig eth0 192.168.1.1  netmask 255.255.255.0 up
     ifconfig eth0:1 10.10.10.1 netmask 255.255.255.0 up
     echo 1 > /proc/sys/net/ipv4/ip_forward
  2. # check on notebook  if you can ping both
  3. # setup other IPs (C, modem) as described above:
     # ADSL: 192.168.1.2
     # PC:   10.10.10.2
  4. # check if you can ping each of them
     # ping on PC should not reach ADSL, and vice versa
0
 

Author Comment

by:timster692001
ID: 7139748
Hello all again, if you are reading, i have come up with the solution myself. The thing is that you are probably all right, however there are easier ways to do things. I used the Internet Connection Wizard in mandrake 8.2 and used a 3com net driver for my ethernet card. Then i used 'host' as the hostname and an ip of '192.168.0.1' as the server. I set it to get an IP with DHCP on boot and restarted Mandrake, thus connected to the internet when i loaded Mozilla. Things are simple, i just wanted a simple answer, i don't want to edit config files, i don't want to recompile my Kernel. Thank you anyway...
0
 

Author Comment

by:timster692001
ID: 7139761
THE closest
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question