You are not logged in.

#1 2008-03-20 13:57:43

Dheart
Member
From: Sofia, Bulgaria
Registered: 2006-10-26
Posts: 956

How to setup NAT?

I have two LAN cards on my PC and I want to let my second PC to use network through the second LAN card with NAT, but I have no clue how to set it up... (My internet connection comes to eth0 and I want NAT interface on eth1(


My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...

Offline

#2 2008-03-20 14:01:17

Purch
Member
From: Finland
Registered: 2006-02-23
Posts: 229

Re: How to setup NAT?

One way is to use arno-iptables-firewall script from AUR. You get NAT and firewall up and going. http://wiki.archlinux.org/index.php/Fir … s_Firewall

Offline

#3 2008-03-20 14:57:02

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: How to setup NAT?

iptables -t nat -A POSTROUTING -o eth0 -j  MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward


Give what you have. To someone, it may be better than you dare to think.

Offline

#4 2008-03-20 19:21:07

Dheart
Member
From: Sofia, Bulgaria
Registered: 2006-10-26
Posts: 956

Re: How to setup NAT?

And can I set an ip address on eth1 or it'll chose a random one and I should set the second machine to dhcp?


My victim you are meant to be
No, you cannot hide nor flee
You know what I'm looking for
Pleasure your torture, I will endure...

Offline

#5 2008-03-20 21:39:53

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: How to setup NAT?

eth1 will have static ip. for e.g 192.168.0.1.
on the other computer you have the configure your network: ip 192.168.0.x, gw 192.168.0.1, nameserver copy from /etc/resolv.conf


Give what you have. To someone, it may be better than you dare to think.

Offline

Board footer

Powered by FluxBB