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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have been trying to get my other windows xp pro connect to my RedHat 9.0 box, so far I can ping, and I don't use dhcp so I configure the ip
, and I use the crossover cable and 2 Network Card to connect them
RedHat : IP 192.168.0.1
Netmask: 255.255.255.0
Windows XP: IP 192.168.0.2
Netmask: 255.255.255.0
DNS Server: 192.168.0.1
Gateway: 192.168.0.1
an I am on dial-up, and I did try to follow this guide (I got this from other site)
Quote:
This is a how-to about sharing the internet via a linux box to the rest of your internal network.
In windows this is know as ICS (Internet Connection Sharing).
In linux it is called NAT (Network Address Translation).
1. On the linux box (that is directly connected to the internet, and is supposed to do the internet sharing), start a terminal. Run the command su and then type the root password to become root.
2. Open the file /etc/rc.d/rc.local in your favorite text editor and add this on a new line at the bottom
/etc/rc.d/rc.ipmasq and save the file.
3. Then, create a new file called rc.ipmasq in the /etc/rc.d/ directory and open this file in a text editor and add these lines
#!/bin/sh
IPTABLES=/sbin/iptables
#All The lines below are NAT routing
# flush any old rules
$IPTABLES -F -t nat
# turn on NAT (IP masquerading for outgoing packets)
$IPTABLES -A POSTROUTING -t nat -o eth0 -j MASQUERADE
This script assumes that eth0 is the ethernet adaptor connected to the internet (say, thru a DSL/cable modem). Change it depending on your configuration (eth1, eth2 and so on). If the connection to the internet is not thru an ethernet device (as in the case of ordinary dialup or USB modem), you have to use ppp0 (or ppp1, ppp2 and so on).
The network connections to the internet and intranet should already be up (how to do that is outside the scope of this document).
4. Make this script file executable by running chmod 755 /etc/rc.d/rc.ipmasq
5. Then run the command /etc/rc.d/rc.ipmasq to enable the internet sharing.
6. Now you can stop being root by running exit
The above script will work after the following have been already done:
Set up the network on all the computers in the LAN. Make sure every computer can be reached from another computer by "ping".
On each client computer, set the gateway to the internal IP address of the linux computer that is connected directly to the internet. Under DNS put in the primary and/or secondary DNS IP addresses of your ISP (Internet Service Provider).
your script flushes nat table only. if there are some rules that can block forwarding or input from LAN, your nat rule cant work.
u can try to generate a script from www.iptables-scrpits.dk and try it.
u must also run named in linux if u assing linux ip as DNS in windowz's network configuration. other way u can use ISP nameservers instead of 192.168.0.1
Hi I just tried to run the named on my RedHat Box but still no luck, Do I need too change somthing on the named.conf.
and is there any website that could guide me step by step on doing this? because I am newbie, just started learning about linux in school
first make sure about iptables rules. connect internet and when u r root, type the followings and post the outputs here:
#/sbin/iptables -nvL
#/sbin/iptables -t nat -nvL
#/sbin/ifconfig
#/sbin/route -n
it is enough to start named, it will work as a caching only nameserver. also u can prefer forwarding dns queries. it can reduce query time.
add the following necessary lines in named.conf
forward first ;
forwarders { ISP_nameserver_ip };
also u can use forward only instead of forward first
read the man page of named.conf
#man named.conf
but u dont have to run named. if u configure windows to use your ISP nameserver, so u wont need to run named in linux. it is up to u.
i have this little problem that i can't seem to figure out.
I'm trying to network my desktop (windows XP) to my laptop (RH9) on a cross-over cable connection. yeah i know it should be the other way but i want internet connection to be shared (AOL works fine with windows).
my problem is i can't even ping each other. i just configured windows ip to 192.168.100.11 and netmask to 255.255.255.0
in my linux box i configured eth0 to IP: 192.168.100.12 subnetmask: 255.255.255.0 and gateway: 192.168.100.11
everything looks ok. now open /etc/rc.d/rc.local file with your favourite text editor. if there are some lines that u added b4 in this file remove them first then copy the following and past it into file. and save it.
/sbin/iptables -t nat -F POSTROUTING
/sbin/iptables -t nat -F PREROUTING
/sbin/iptables -t nat -F OUTPUT
/sbin/iptables -F
/sbin/iptables -P INPUT DROP
/sbin/iptables -P FORWARD DROP
/sbin/iptables -P OUTPUT ACCEPT
/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -j MASQUERADE
/sbin/iptables -A FORWARD -j ACCEPT -i eth0 -s 192.168.0.0/24
/sbin/iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
echo 1 > /proc/sys/net/ipv4/ip_forward
after that, restart your computer. and after reboot it must work.
reihat, sorry that post was for Cloud78. i think when i was typing my input u sent your post.
hmmm the ping trouble:
1- maybe NIC or cable doesnt work. check the ligths of NICs. if its ok:
2- firewall can cause this. check firewall at both side.
3- there can be other reasons i couldnt remember (know)
reihat have u tried enabling ics (internet connection sharing) with ur xp machine in which case this will allocate the ip address of that machine which u can then add into ur linux connection settings which makes life a whole lot easier :-) U obviously have the right idea with addresses and as maxut says also check ur firewall (especially on xp setting it to medium or which ever it is to allow networking to local addresses)
Originally posted by maxut reihat, sorry that post was for Cloud78. i think when i was typing my input u sent your post.
hmmm the ping trouble:
1- maybe NIC or cable doesnt work. check the ligths of NICs. if its ok:
2- firewall can cause this. check firewall at both side.
3- there can be other reasons i couldnt remember (know)
i guess i was really that sleepy last night. just woke up and took linux rescue as my breakfast.
i am using wingate for internet sharing because for some reason i can't share internet when using windoze to windoze or it's just me who's too dumb for this network thingie.
anyway i'll try to uninstall wingate and will enable ICS for this.
by the my specs are:
AMD Athlon 64 3400+
Gigabyte K8NSNXP (this has a dual LAN on board - i dunno if this has something to do with the trouble I am experiencing)
Originally posted by reihat i am using wingate for internet sharing because for some reason i can't share internet when using windoze to windoze or it's just me who's too dumb for this network thingie.
Wingate is a proxy server, which requires cofiguring your web browser. ICS is simpler.
And for Cloud78....Try using Webmin to configure NAT. It's easier than using just the scripts.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.