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 11-08-2005, 11:53 AM   #1
muhon
LQ Newbie
 
Registered: Oct 2005
Location: Lima - Peru
Distribution: Mandriva One 2008.1
Posts: 9

Rep: Reputation: 0
Internet Sharing with 3 eth devices problem, Mandriva 2006


Hello. I'm currently having trouble configuring internet connection sharing in Mandriva 2006. This are the facts.

I used to have a D-Link 604 Router, but it's not working anymore so I sent it to a technitian. I have 3 computers ad home, 1 with Linux and the other 2 with WIN XP. So, as a temporary solution, I'm trying to make my Linux PC a PC-Router.

I used to do this in windows, but I want to do it in Linux as the hdd is small. I'm using Mandriva Linux 2006. I have 3 NIC, 1 which comes integrated (eth0, nVidia nForce2 controller) and 2 Realtek cards (eth1 and 2, respectively).

I've found some problems:

1) dhcpd won't work with the 2 devices at the same time.
2) I can't configure eth1 as 192.168.1.1 and eth2 as 192.168.1.2 with mcc's internet connection wizard, mcc stops saying Potencial LAN Address Conflict found with current config of eth1.
3) I managed to have 2 different LANs using this dhcpd.

Code:
ddns-update-style none;
subnet 192.168.0.0 netmask 255.255.255.0 {
	# default gateway
	option routers 192.168.0.1;
	option subnet-mask 255.255.255.0;

	option domain-name "cpe.cablenet.com.pe";
	option domain-name-servers 200.48.0.50;

	range dynamic-bootp 192.168.0.16 192.168.0.253;
	default-lease-time 21600;
	max-lease-time 43200;
}
subnet 192.168.1.0 netmask 255.255.255.0 {
	# default gateway
	option routers 192.168.1.1;
	option subnet-mask 255.255.255.0;

	option domain-name "cpe.cablenet.com.pe";
	option domain-name-servers 200.48.0.50;

	range dynamic-bootp 192.168.1.16 192.168.1.253;
	default-lease-time 21600;
	max-lease-time 43200;
}
dhcpd works here, giving the right ip/subnet/dns to both computers... however, no internet on neither.

4) I proceeded with IP masquerading. I made a .bin so it wouldn't be so tedious to write masquerading. By the way, I'm using a Cablemodem that connects directly to the internet, and gives eth0 a public IP.

Code:
ifconfig eth1 192.168.0.1 netmask 255.255.255.0
ifconfig eth2 192.168.1.1 netmask 255.255.255.0

/sbin/modprobe iptable_nat
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
service dhcpd restart
Still no internet is shared.

5) I can manage to share internet with 1 device by using the mcc wizard, but not with both. It's of great importance to give internet to both clients, as mom and my brother need to work without kicking me of the linux machine

6) Ah, also, I read something about using dhcpd 2 times for each device. I tried the following, as I copied it from the web page:

Code:
dhcpd -cf dhcpd-eth1.conf eth1
dhcpd -cf dhcpd-eth2.conf eth2
where dhcpd-eth1.conf is half of the dhcpd.conf I wrote above (the eth1 part). Didn't work. (Something about invalid sintax).
 
Old 11-08-2005, 01:12 PM   #2
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
To get the behavior of a commerical router, bridge interfaces eth1 and eth2 (ethernet bridging) as br0, then forward br0 to eth0, and use dhcpd on br0.
 
Old 11-08-2005, 06:08 PM   #3
muhon
LQ Newbie
 
Registered: Oct 2005
Location: Lima - Peru
Distribution: Mandriva One 2008.1
Posts: 9

Original Poster
Rep: Reputation: 0
How exactly do I bridge eth1 and eth2?

Would I still use

Code:
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
to forward eth0?

Thank you very much.
 
  


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
mandriva 2006 disconnects me from internet AGazzaz Mandriva 4 11-28-2005 01:52 PM
Boot problem on X41 running Mandriva 2006 msjarrell Linux - Laptop and Netbook 2 11-25-2005 07:35 PM
problem with Mandriva 2006 _gnomm Mandriva 6 11-24-2005 11:43 AM
Network problem with mandriva 2006 edgarcillo Mandriva 1 11-12-2005 11:46 AM
mandriva 2006 display problem vmitjans Mandriva 2 10-27-2005 01:04 AM

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

All times are GMT -5. The time now is 06:25 PM.

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