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 just installed Slackware 10.0 and I installed two Ethernet cards on the computer. I got eth0 to connect to the Internet and eth1 (192.168.0.1) to connect with my laptop. I searched around the Internet reading guides to setting it up and I tried using rc.ip_forward but my laptop won't connect to the internet.
I'm using this script:
Code:
echo "1" > /proc/sys/net/ipv4/ip_dynaddr
iptables -F
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
iptables -A INPUT -i ppp0 --source 192.168.1.0/24 -j DROP
iptables -A INPUT -i ppp0 --source 10.0.0.0/8 -j DROP
iptables -A INPUT -i ppp0 --source 172.16.0.0/12 -j DROP
iptables -A FORWARD -i eth0 -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -m limit --limit 5/minute --limit-burst 5
That should start making your Slackware box forwarding the packets for your laptop onto your laptop and by setting the laptop's default gateway to your slackware box the packets from the laptop will go though the slackware box and out to the Internet.... (Like a router)
I hope that helps and work... Post back with results!
ok so ur slackware box is acting as ur server for the internet and ur laptop is wanting to share this connection so the ip addy of ur slackware is also ur gateway and dns server, so try adding the addy of that to your laptop in /etc/resolv.conf
nameserver 192.168.0.1
in your network device control in both machines u can try statically assigning addresses
192.168.0.1
subnet 255.255.255.0 (for ur server)
in a terminal window in each machine try pinging the other and make sure u can `see` each other if so then in reality u should be able to `surf` on both machines
and
192.168.0.2
subnet 255.255.255.0
gateway 192.168.0.1 (for ur laptop)
see how that goes any probs post back :-) (I am not sure what ur set up is to connect to the internet adsl/modem/router or cable) but that`s the basics of it
it`s very late here and have to be up for work in the morning but am giving u a link which will answer ur question :-) http://www.cisco.com/warp/public/105/21.html
will post tomorrow if u r still no further on :-)
So if IP_FOWARDING is on, it will atomically route the packet? I still don't get why you don't have to set up a route, otherwise the kernel dose not know which NIC to send it on...
*laughs*
You guys lost me. I guess I lost you guys too, I thought it would be easy to do this, I guess I took linux too lightly. I'm just too used to Windows with that Internet sharing button.
i tried to do tracert/traceroute on an IP and it does go to the gateway (192.168.0.1) but my nix box doesn't do anything from there. IP forwarding should be on on boot.
Oh and I'm connected on cable through eth0. I know the internet is working because I used lynx and ftp.
OK so we know your labtop works fine is correct set up, but the main box is not fowarding... We you posted route -n it did not have the route in there so try this one more time...
route add -net 192.168.0.2 netmask 255.255.255.0 dev eth1
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.