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've recently installed SuSE 8 on one of my computers and this is the system that is connected to the Internet via a cable modem. With this being the first full installation like this I am happy to get this far
The problem I have now is that I'm unable to connect my windows boxes to the internet. I'm able ping the SuSE box from my windows boxes but unable to ping external sites like google etc.
Can anyone point me in the right direction to solve this problem?
setting up a firewall is highly dependent on what services you want it to run.
you need to enable ip forwarding on the linux box for this to work.
you can have it set at bootup by putting this command in /etc/rc.d/rc.local
# Enable ip forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
you can set it from the command line also
Unless you have valid ip addresses for each box ( not likely )
you need to masquerade the LAN clients local ip addresses, this will allow your linux box to act as a router that makes all clients appear to be one machine on the internet...
consider eth0 in this example to be the internet connection, not the LAN connection
-A POSTROUTING -o eth0 -j MASQUERADE
Go here to get scripts for all types of firewall configurations.
I tried entering "enable ip forwarding echo 1 > /proc/sys/net/ipv4/ip_forward" at the shell command line and got the following message.
bash: enable: ip: not a shell builtin
bash: enable: forwarding: not a shell buitlin
bash: enable: 1: not a shell builtin
When I entered - "echo 1 > /proc/sys/net/ipv4/ip_forward" nothing happend?
When you say a valid IP I guess you don't mean 192.168.1.100 etc? this is all I have other than the SuSE box which although it is on a cable modem it still gets it IP via DHCP.
When I typed "iptables -A POSTROUTING -o eth0 -j MASQUERADE" I get the following message:
iptables: No chain/targetmatch by that name?
That has sorted it, I've got the fastest connection ever (for me)
There's a few other things I'll need to work out (like getting quicktime on the windows boxes)but now I've got my net connection back it wont be to much trouble (i hope)
Thanks a lot for your help, I've learned a thing or two...
I've added the following info to: /etc/rc.d/rc.local
# Enable ip forwarding echo 1 > /proc/sys/net/ipv4/ip_forward
Now this works fine but with this alone I was unable to connect through my Linux box. I then typed: -A POSTROUTING -o eth0 -j MASQUERADE and this allowed my Windows boxes to connect to the web.
My question now is this, can I add -A POSTROUTING -o eth0 -j MASQUERADE to /etc/rc.d/rc.local so that it will be automatically started when I boot up? If so what format should I use?
Following from what you said I thought I'd try and work it out, so I added this # Enable routing
iptables -A POSTROUTING -o eth0 -j MASQUERADE to the same rc file as
# Enable ip forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
When I rebooted I got this message in the console log window:
Jan 3 22: 38:27 linux kernel: ip_tables: (C) 200-2002 Netfilte core team
This I thought would have sorted it, but it didn't.
I then tried entering the command manually and when I typed iptables -A POSTROUTING -o eth0 -j MASQUERADE
I got this message No chain/target/match by that name
After this I removed # Enable routing
iptables -A POSTROUTING -o eth0 -j MASQUERADE from the rc file and rebooted. When I got back to the console I typed it again but got the same message. This time I removed # Enable ip forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward from the rc file and rebooted again.
When I typed echo 1 > /proc/sys/net/ipv4/ip_forward into the console and hit enter I didn't get the 1 or 0 or anything it went straight back to the command line?
Do you know what I've done and how to get it sorted?
Thanks for your help.
Tezdread
"With every solution comes a new problem"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.