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).