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 a question
i have a linuxbak with 2 network cards
eth0 ip: 10.0.0.138/ 255.255.255.0 connected to the adsl router ip 10.0.0.138/255.255.255.0
eth1 ip: 192.168.1.1/255.255.255.0 connected with a swith and a pc 1p: 192.168.1.3/255.255.255.0
how can i edit the routing table so i can acces internet throw the linux machine or do i have to change my netmasks???
1)Set the default gateways on each PC on the inside of the linux router to being the IP address of the linux router.
2) Enable ip forwarding on the linux router only:
echo 1 > /proc/sys/net/ipv4/ip_forward
3) Enable ip masquerading on the linux router only:
$IPTABLES -A FORWARD -i 10.0.0.138 -o 192.168.1.1 -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -i 192.168.1.1 -o 10.0.0.138 -j ACCEPT
no - the gateway should be the 192.168.1.1 address.
did you run iptables an not ipchains? My commands shold have been:
/sbin/iptables -A FORWARD -i 10.0.0.138 -o 192.168.1.1 -m state --state ESTABLISHED,RELATED -j ACCEPT
/sbin/iptables -A FORWARD -i 192.168.1.1 -o 10.0.0.138 -j ACCEPT
i can now telnet my router but i dont have a connection to internet my router give out ip adresses by dhcp but i put a static ip for my eth0 from my linux server can that be the 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.