• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

help in iptables


I have the following two ethnet setup


Eth0 123.123.123.123  
Eth1 192.168.170.5

The route is set as eth0 (123.123.123.123 ) default gateway for all the trafic going outside.

Now, I would like to setup that any trafic going out for 192.168.168.X should use eth1 for the source address.

How do I get this work?
0
raza
Asked:
raza
  • 3
1 Solution
 
NopiusCommented:
Do you mean that:
route add -net 192.168.168.0 netmask 255.255.255.0 gw 192.168.170.5 dev eth1
0
 
NopiusCommented:
gw 192.168.170.5 should be ajusted according to your network topology
0
 
razaAuthor Commented:
thanks..

how do I del one... I accedentally created for the wrong ethernet infterface. now, I need to delete one.
0
 
NopiusCommented:
if you need to delete route, use
route del x.x.x.x gw y.y.y.y
command

if you need to delete NIC card, just pull it off your PC :-)

if you need to disable NIC card, use:
ifconfig ethX down

0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now