I was trying to capture localhost traffic with Ethereal, which doesn't work without re-routing localhost traffic to your router gateway. I didn't get the route command quite right, and messed up my routing table. I typed route -f to clear the routing table and rebooted, but when I finished rebooting, the routing table wasn't restored to its original state.
I'm using iproute2 to set up policy routing as follows:
echo 200 $table >> /etc/iproute2/rt_tables
ip rule add from $my_ip table $table
ip route add default via $gw_ip dev $dev table $table
ip route flush cache
Where $dev is a device set-up by OpenVPN. This way everything bound to $my_ip, would go through $gw_ip.
I have a linux system with two network interfaces (eth0 in x.x.x.0 and eth1 in x.x.y.0). Is there any posibility to add some route policy to send all the traffic to network x.x.y.0. I would like even the traffic from eth0 to be send to eth1's network.
I cannot delete the direct connected networks from the routing table so all the traffic from x.x.x.0 network is send to eth0.
I am setting up packet routing via a host computer. In order to try out a simple case. I set up a small local network of 3 linux PCs X,Y,Z. These 3 get their IP from a DLink router that I have.
I have 2 servers and I need to forwart to internal port.
To explain I use the server with 2 interfaces (internal/external) as server A and the internal server as server B.
In server A i use
iptables -A PREROUTING -t nat -i $extif -p tcp --dport $extif_port -j DNAT --to-destination $dst_ip:$dst_port"
iptables -A FORWARD -t filter -d $dst_ip -j ACCEPT"
iptables -A POSTROUTING -t nat -p tcp -s $ds
We've recently installed a second Internet connection so I've somewhat successfully configured policy based routing on the edge router which is a Juniper J4350 running JunOS 9.5R1.8.
Hello everyone.
First, I'm no linux expert. I know some basics of networking and windows servers mostly. And now I want to use a Linux distro (Centos 5.4) to build up a firewall for my servers on my hosting company.
What I want to / have to configure is:
- A linux router
- Which works on transparent routing mode (I guess its opposite to NAT mode)
Ive got a Dedicated Server with 2 Public IP Adresses and would like to route all eth0:1 traffic to a KVM Guest via iproute2 or even iptables. Outgoing Traffic should also be routed to eth0:1 - eth0 and eth0:1 are assigned in different Subnets.
Setup is/should be as following:
178.1.2.3 eth0:1 <-> 192.168.1.254 br1, gateway for tap1 <-> 192.168.1.1 KVM Guest
i have a dedicated openVPN server sitting behind a NAT router and i have the server's static IP set in the DMZ; the problem is that with current rule set (as seen in the screenshot below) i cannot connect to the VPN server from the internet, nor SSH for that matter; however, if i allow traffic on eth0 all is fine but that pretty much allows any kind of traffic to reach the host and that completely