PDA

View Full Version : How to configure Ubuntu using 2 NICs?


new2linux2
25th May 2009, 19:12
Hi All

I am very green on the Linux stuffs.

I have 2 NICs in my PC and I am trying to setup the following:

INCOMING ---------------------------------------------OUTGOING
[PC1 say IP 192.168.1.5]----> [PC2 eth0] and forward to [PC 2 eth1] ----> [PC3].

Meaning that [PC2 eth0] received traffic from [PC1 IP 192.168.1.5] and forward the traffic out to [PC2 eth1] to [PC3]



Is this possible ? If so, how do I do this.

Thanks in advance.

id10t
26th May 2009, 15:52
Yup. First you'll want to play with the udev persistent rules for net devices and make sure eth0 stays eth0 (done via MAC address) and eth1 stays eth1.

Then you'll need to enable IP forwarding.

Then you'll need to probably set up a firewall, etc.

new2linux2
27th May 2009, 18:10
Thanks id10t,

I checked the "/ect/udev/rules.d/persistent-net.lues, the MAC addresses are corresponded to the proper eth.

To enable the IP forwording, do I do it under the "/etc/init.d/iptables.sh" ?

How do you setup the firewall under Ubuntu?


Many thanks for your help.

falko
28th May 2009, 12:53
To enable the IP forwording, do I do it under the "/etc/init.d/iptables.sh" ?


Open /etc/sysctl.conf and add the line
net.ipv4.ip_forward=1
Then run
sysctl -p