Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have a small LAN (10 comps). I have a router (192.168.1.1) and i am 192.168.1.80. Now, I have already set up IP forwarding as according to the Gentoo Home router Guide(even though i use slackware). Other comps on the LAN can use me as their localnet router.
BUT, We also have a ppp connection to eticomm.net. I have already set up wvdial(automatic dialer) to connect and i can. I need to be able have all comps on the LAN get out to the internet. I use Static IP for IP address handling.
Does anybody know the correct iptable command to issue and also the correct kernel routing tables? This is an interesting experiment(for fun) but if i can get it working i will start using it as the ppp gateway for the whole LAN.
search about "iptables" and "masquerading" on google, you should find some good example as it is a very common way to share ppp connection. The rule would be like "$IPTABLES -t nat -A POSTROUTING -o ppp+ -s ! 192.168.1.0/255.255.255.0 -j MASQUERADE"
Of course you will need to ajust this to fit your setting... You also need to activate ipv4 forwarding and to allow FORWARD with iptables. See google
i have searched this site and google but i fail to find anything. Anyways should be that in the bottom of the tables? I would think that that should go in the bottom but i am seriously confused about iptables syntax(especially after reading the iptables HOWTO :-) ) those 25+ options are flying around in my head. Is the 192.168.1.0 suppose to be my IP?
P.S. assuming this works what would the IP routing tables look like on a client machine?
Iptables can be a bit scaring in the begginning but you won't use all these options, ever
The 192.168.1.0 should be your subnet ip. I assumed your range was 192.168.1.0/255.255.255.0 ( or 192.168.1.0/24 in CIDR notation) so it should be correct if it's the case. This is basic networking knowledge.
The routing should look like the following
Table de routage IP du noyau
Destination Passerelle Genmask Indic Metric Ref Use Iface
6.3.128.1 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 127.0.0.1 255.0.0.0 UG 0 0 0 lo
0.0.0.0 6.3.128.1 0.0.0.0 UG 0 0 0 ppp0
# Change LAN to the correct network address and network mask for your LAN
# this can be found by using ifconfig from one of the clients
LAN="192.168.0.0/24"
I dont really know what address to use from the output of ifconfig. Anybody know?
I told you, you have to use the network mask (netmask). This is somehow the "ip range". It's a bit difficult to explain, but let's consider this is your network ip but with a "0" on the numbers that may change (as example, if your computers are on 192.168.1.1, 192.168.1.2, 192.168.1.3, the "number that change" is obliviously the last one), then you write "255" for every number that are static and 0 for the ones that may change ( so in that case you would have 192.168.1.0/255.255.255.0 ).
Just as example, in the case you would be on a "10.0.0.0" network, the netmask would be ( 10.0.0.0/255.0.0.0 ).
This should get you started but it is usually way more complex than that.
However, all this is very basic networking skills, if you don't know netmask yet, you will have hard time managing a 10 computers LAN, you might want to consider to read some documentations on networking at first.
It is a family LAN(i am 13). I am not really admin on the LAN(everybody takes care of their own comp) but i am interested in learning all their is about networking(i figured this would be a good project). Sorry for my previous post i posted before i saw that you posted again. Thanks
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.