LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 01-31-2007, 11:47 PM   #1
zaheer
Member
 
Registered: Apr 2004
Location: Linux World
Distribution: Debian,Free BSD but Currently Using PCLinuxOS
Posts: 32

Rep: Reputation: 15
Post eth0 and eth1


Hi allz,

Here is my situation.I am running slackware,I am connecting to my gateway through Ethernet and its running on DHCP and giving me the same IP whenever I start my computer and assign the IP to eth0.I have another ethernet card (eth1).I want to connect another PC(webserver) for my practise work through eth1 .so how can I do this to connect to that webserver and use net through eth0 also.

Diagram :

Internet----->Gateway+DHCP Server---->my system (with eth0 & eth1)-----> Local Webserver

Last edited by zaheer; 01-31-2007 at 11:51 PM.
 
Old 02-01-2007, 01:41 AM   #2
Quis
Member
 
Registered: May 2001
Location: Germany, Süd-Baden
Distribution: Gentoo
Posts: 139

Rep: Reputation: 15
Hi,

if you want to use the first box with the two ethernet devices as 'man in the middle' like this:
('Gateway' - '2 Ethernet Device Box' - 'second Box')

You should search for how to configure you 'man in the middle' box as a bridge or better as a NAT-router.

Last edited by Quis; 02-01-2007 at 01:42 AM.
 
Old 02-01-2007, 01:44 AM   #3
blackhole54
Senior Member
 
Registered: Mar 2006
Posts: 1,896

Rep: Reputation: 61
To make sure I understand: You want your webserver to be accessible from the Internet and you want your "my system" box to have Internet access?

I would think "my system" should already have Internet access. To make your webserver accessible from the Internet you need to set up DNAT on your Gateway and tell it to use "my system" as the gateway for your webserver (check the manufacturers documentation) to forward incoming connections to your webserver, and you need to enable ip forwarding in "my system." Both eth1 and the Webserver use static IP addresses?

There are several ways to enable ip forwarding. One way is to add

Code:
net.ipv4.ip_forward = 1
to /etc/sysctl.conf.

Have you considered simply connecting your webserver directly to the Gateway? I would think that would be (slightly) simpler.
 
Old 02-01-2007, 03:32 AM   #4
zaheer
Member
 
Registered: Apr 2004
Location: Linux World
Distribution: Debian,Free BSD but Currently Using PCLinuxOS
Posts: 32

Original Poster
Rep: Reputation: 15
Post

Currently I want to access my webserver for learning purposes and dont want others to access it.How can I do it and do it as you said with man-in-the-middle-box situation.

Thanks For quick response
 
Old 02-01-2007, 03:50 AM   #5
Quis
Member
 
Registered: May 2001
Location: Germany, Süd-Baden
Distribution: Gentoo
Posts: 139

Rep: Reputation: 15
So this is simple, simply connect the eth1-device from the 'man-in-the-middle' with a cross-over-cable to the second machine.

then configure the ip from eth1 like this:

man-in-the-middle-box 192.168.5.4
http-server 192.168.5.5

with a subnetmask say 255.255.255.0.

then start the http-server on 192.168.5.5 and try to connect within you browser on the 192.168.5.4-box to http://192.168.5.5.

This should work if your http-server is listening on Port 80.

Good luck
 
  


Reply



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
howto acess intrnet thru eth1(wireless card)in winXP via briging in linux(eth0-eth1) labhesh_popli Linux - Wireless Networking 1 09-21-2006 01:11 AM
Wireless network on eth1 diabled Ethernet eth0 and eth0 never comes back tadatoshi Linux - Wireless Networking 4 09-23-2004 05:57 PM
Firewall WAN eth0 LAN eth1 self-bridges, eth0 does all routeing. Nichole_knc Linux - Networking 5 07-29-2004 02:33 PM
eth1 added, mysql connections FROM this machine are from eth1. Need bound to eth0??? kreese Linux - Networking 9 03-31-2004 12:12 PM
Kernel 2.4.22 finds eth0 and eth1 but 2.6.0 does not find eth1 coollink Linux - Networking 3 01-13-2004 07:32 PM

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

All times are GMT -5. The time now is 09:41 AM.

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