Assumptions: You have a router connected to your isp and the internal IP for the router is 10.0.0.11 and the external is 81.120.X.X. You have a Linux machine that you want to set up as another router that gives out ip's in the range of 192.168.0.1 - 192.168.255.254 (helluva lot of IPs to give out). Eth 1 is connected to the router (the DSL/Cable router) and Eth0 is connected to another private network. If any of this is wrong let me know because the rest depends on it.
A copule things, the netmask and IP for eth1 are off, all 0's specify a network and should not be used as an IP address and also 192.168.0.0 is class B and therefore cannot have a mask of 255.0.0.0, it should be 192.168.0.0/16 or 192.168.0.0/255.255.0.0 as a matter of fact, any IP address that begins with anything over 126. is a class B or C but that's another discussion.
Problem 1:
You can TRY 2 things: to set up DHCP on an interface, use the command dhcpcd (NOT dhcpd)
$dhcpcd eth1
which has me wondering why you have it set up as 192.168.0.0
a second thing to try is hard coding an IP into the interface that is on the same subnet as the DSL ROUTER (i.e. 10.0.0.100). I don't know how to set the ip of an interface through command line, double check this line, i've never used it:
#ifconfig eth1 10.0.0.100/8
note: your router probably only gives out adress from 10.0.0.1 to 10.0.0.254 in which case your line would be:
#ifconfig eth1 10.0.0.100/24
try both of those to get into the web configuration thiny on the router. I'ts linux so you shouldn't have to restart the computer or anything for the changes to take effect.
Problem 2:
When you get into the router, make sure it's setup for DHCP and check the status to make sure you have a connection to the internet through the router. From the linux machine you should be able to ping the router:
#ping 10.0.0.11
If you hard coded the ip using the ifconfig method then you will also have to hard code the DNS servers and gateway. The DNS servers will be given to you by your isp and the gateway is 10.0.0.11 (the router). I have never put in a gateway manually from command line but the DNS serves can be planced in a file called resolv.conf (/etc/resolv.conf)
Yo, just get DHCP working. If you just cant get DHCP working, I'll post more detail on hardcoding everything later. If you have DHCP working and the router is connected to the isp, the router will automagically handle the DNS info and gateway info for you. So just try dhcpcd eth1
You dont need to mess with the hosts file to get a network connection, that's just for resolving host names (converting a machine's name to an IP address). We are dealing only with IP's so its cool.
as far as that iptables thing goes, you just gave away your ip address and network topology, you better hope there are no malicious hacker types reading this post.
Problem 3:
huh?? Just to get an internet connection off the DSL router you dont need to mess with the host file, and DNS goes in /etc/resolv.conf but if you have DHCP working on the router you dont need to touch that either.
Last edited by Robert0380; 04-16-2003 at 12:57 PM.
|