I have  a router with two Internet WANs: DSL (vlan1) and wireless client (eth1). They are both in default route: vlan is the first and eth1 is the second (I am using ip route add default scope global nexthop via …).   I want to use eth1 Internet from my laptop using socks proxy. I tried to use srelay socks server with –J eth1 option on the router but it didn’t  work (page loads forever) although it works through DSL if I use –J vlan1. I also tried to use ssh as a socks server and mark packets with iptables to route them to eth1 using ip rule:  iptables -t mangle -A OUTPUT -o vlan1 -j MARK --set-mark 1   After this command every program on the router starts using eth1 but I need that only the socks server uses eth1. Is it possible to mark only socks server packets? Now I have to use the second router for this purpose. I run socks server on it and add ip rule for its IP on the first router.   I already tried  and it didn’t work. It’s not "duplicate" because I need this for proxy server on router. The problem is that I can’t mark packets based on port number because proxy server doesn’t keep this mark while proxyfing.
118305
My question is basically the same as .  I have two interfaces eth1 (10.0.0.2) and wlan0 (192.168.0.2). My default route is for eth1. Let's say I want all https-traffic to go through wlan0. Now if I use the solution suggested in the other question, https traffic will go through wlan0, but will still have the source-address of eth1 (10.0.0.2). Since this address is not routeable for the wlan0 gateway, answers won't ever come back. The easy way would be to just set the bind-addr properly in the application, but in this case it is not applicable.  I figure I need to rewrite the src-addr:  # first mark it so that iproute can route it through wlan0 iptables -A OUTPUT -t mangle -o eth1 -p tcp --dport 443 -j MARK --set-mark 1 # now rewrite the src-addr iptables -A POSTROUTING -t nat -o wlan0 -p tcp --dport 443 -j SNAT --to 192.168.0.2   Now tcpdump sees the outgoing packets just fine and ingoing packets arrive for 192.168.0.2, however they probably never end up in the application, because all I ever get to see, is that the application is resending the SYN-packet, although the SYN-ACK was already received.  So I thought, maybe I need to rewrite the incoming address too:  iptables -A PREROUTING -t nat -i wlan0 -p tcp --sport 443 -j DNAT --to 10.0.0.2   but that didn't work either. So I’m kind of stuck here. Any suggestions?
59903
I have two network cards. If I connect to a network using VPN then to access other websites I have to pass through a proxy server.  Is it possible to use my other network card to connect to the Internet directly without passing through the proxy?
73104
So I have been trying to convert my linux box which is running Mint into an router. eth0 has a public address that has 71.xx.xx.xx for an IP addr. I created an eth0:0 and set it an IP address , 10.0.0.100. I started a DHCP server that is on eth0 ( because it wont use eth0:0) and that's giving out addresses between 10.0.0.101 and 10.0.0.200. I can ping between eth0 and eth0:0 on the same machine. I have a another laptop connected to the linux via a switch and its able to receive an ip addr via the DHCP server. Problem is how do I route traffic from and to eth0:0 to eth0 and vice versa so that computers on the private network that is 10.0.0.x can access internet via the static IP on eth0.
66258
I'm new on CentOS. I have a CentOS 6.4 system having 2 NIC cards. I want to setup a gateway so I can get internet from public ip over 1st nic card (eth1) and forward the network over 2nd nic card (eth2) so it can be accessible to my local network. I made a DNS server in same system. my gateway system is able to ping to both DNS and google but my client systems are not.  I tried to set the iptables rules it works ping to local gateway but unable to ping to public DNS and www.google.com from client system..when I ping to google.com said that host is unreachable.  How can I implement this, please help me?   public ip is(eth1) : x.x.x.x my local network is (eth2) : 192.168.x.x   I used this for setting up iptables:  iptables --table nat --append POSTROUTING --out-interface eth1 -j MASQUERADE iptables --append FORWARD --in-interface eth2 -j ACCEPT  echo 1 &gt; /proc/sys/net/ipv4/ip_forward   Routing table:  Kernel IP routing table Destination          Gateway             Genmask           Flags     Metric      Ref    Use Iface local ip             0.0.0.0             255.255.255.0       U        0          0        0 eth2 public ip            0.0.0.0             255.255.255.0       U        0          0        0 eth1  0.0.0.0         my local gateway         0.0.0.0             UG       0          0        0 eth2   Iptables:  Chain PREROUTING (policy ACCEPT 9761 packets, 1239K bytes)  pkts bytes target     prot opt in     out     source               destination  Chain POSTROUTING (policy ACCEPT 14666 packets, 1001K bytes)  pkts bytes target     prot opt in     out     source               destination   345 41722 MASQUERADE  all  --  *      Auto_eth1  0.0.0.0/0            0.0.0.0/0  Chain OUTPUT (policy ACCEPT 15011 packets, 1043K bytes)  pkts bytes target     prot opt in     out     source               destination   Please tell me what are changes I have to do in configuration.
38976
Okay, I'm struggling a bit here. I'm not all that good with Terminal and sorting out network issues using it but I've managed to scrape by so far.  Without using Internet Sharing (because controlling that via Terminal as per  doesn't actually seem to work in Yosemite) how can I share my internet connection from one interface (lets say en0) to another (again, lets say en1)?  I kind of understand that Internet Sharing creates a bridge (usually called bridge100) and then uses bootpd (I think) to establish a DHCP server and NAT to route all traffic from 192.168.2.xxx (which is the bridged network) through to your primary network.  How can I get the same result without using the Sharing pref pane?
82477
I have two internet connections from two different ISPs and I need to balance the traffic originating to and from my network between the two ISPs. I am using Debian GNU/Linux.  My set-up is like this -  eth0 (192.168.0.0/24) -- Local network  eth1 (192.168.1.0/24) -- ISP #1  eth2 (192.168.2.0/24) -- ISP #2  My local network is connected to this server via eth0 and the box is the DHCP server cum Gateway for all the machines in the LAN.  The server needs to do load-balancing between the two ISPs and also needs to do NAT-ing.  I have followed the routing instructions on  but I still need instructions to do the NAT-ing properly.  Any help will be appreciated.   PS - I know about pFsense but I need to use Linux.
78140
If I use  two different router in the same network while both are running in the default router mode then we can access the setup page or setup interface from browser just by IP address of corresponding router. But when I use one of the router as repeater then I can only enter the setup page of the router which is running in router mode. Why router's setup page cannot be accessed when using the router as repeater? Now how can I change the settings of the router in repeater mode? The only way is to reset router with the hardware key then setup again.
76181
My DSL/WiFi router provided by my ISP has an internal IP address of 10.0.0.138, the addresses provided by DHCP are in the format of 10.0.0.xxx.  Now, I want to start using static IP addresses on my local network, and I don't know what to provide for the subnet mask.  What is a subnet mask?  Should I be using 255.255.255.0 or 255.0.0.0 as my subnet mask? What is the difference?
113009
I host multiple domains on a single IP address:    cats.com  A @ --&gt; 10.20.30.40 A mail --&gt; 10.20.30.40 MX @ --&gt; mail  dogs.com A @ --&gt; 10.20.30.40 A mail --&gt; 10.20.30.40 MX @ --&gt; mail   I need to set up a PTR record for the IP address. This is so that forward-confirmed reverse DNS will succeed for other mail servers.  DNS query type PTR on 10.20.30.40 --&gt; returns PTR-record="cats.com" (1 result) DNS query type A on "cats.com" --&gt; returns A-record=10.20.30.40 (1 result)   If I can only have one PTR record for my IP, that points to cats.com, how will FCrDNS ever succeed for dogs.com?    Can I just use the domain name they both share (80.70.60.50.static.host.net) in the PTR ?  Thanks!
101097
I have a Windows 8 machine that has only a single Ethernet port. It needs to use DHCP and also needs a static IP. Each IP is in a different subnet, and each serves a different, incompatible purpose. This machine must use DHCP because the site network admin says this is the only supported way to get a 192.168.x.y address. Either his network scheme doesn't have a static IP block within that subnet, or he won't assign one of them to this machine. I can't risk using a DHCP-assigned IP statically, betting it won't be reassigned after the lease expires. That would let me use Windows' ability to assign multiple static IPs to the interface, but this is a production server, not something I can risk getting bounced off the network hours or days later. I realize that some DHCP servers let you set up static MAC to IP assignments, so that my machine's DHCP IP is never reassigned, but since I know of no DHCP server that will issue two different IP addresses, each in a different subnet, that's no help here. (And if there is such a DHCP server, my client probably doesn't use it and wouldn't change over to it if I asked.) Since I can't do this entirely with DHCP, I need a static IP because this machine also acts as a server to a 10.x.y.z subnet. The local network admins have given me a static IP in that scheme, but it's insufficient because I also need to talk to the 192.168.x.y side of the network. I'm aware of a similar question . I'm asking again because:  That other question was posed when Windows 7 was current. Perhaps Microsoft used those 2+ years to fix this weakness in the Windows 8 network stack implementation? (Yes, weakness: Linux allows a network interface with both a DHCP and a static IP. There's nothing about TCP/IP that prevents Microsoft from allowing this. They just have to write the code to allow it.)  It seems the network configuration GUI in Windows 8 has the same limitation as Windows 7's, but perhaps there is some low-level hack that will let us assign a static IP alias to the DHCP interface?
21805
According to everything I read, the entire 127.x.x.x subnet should loopback.  However, on my Mac, I can only ping 127.0.0.1  I know I've done this before (though possibly on another OS) and has come in very useful for developing multiple SSL sites locally and for tunneling remote services for access on a local IP (for example I could ssh into my MySQL server, and just port forward the standard port to the same port on my local machine but on 127.0.0.2 while my local server ran at 127.0.0.1.
66598
I want to map the IP address 192.168.1.222 to 127.0.0.1 so that if I use 192.168.1.222 in the web browser or ping command I get the response (and that from my 127.0.0.1).   Is this possible via routing tables or do I have to add some sort of virtual network adapter?   I try to deal with this problem on a Windows 7 machine and have no other options than a Windows XP maybe.  I'm stuck right there.
17863
I have a php / bash application on top of a Linux machine with 1 physical interface connecting to e.g., outbound webserver 123.123.123.123 :80. I do this via several openvpn providers. I have both tun and tap providers, but my favorite provider uses tun.  Actually I'm perfectly able to serially:   open the vpn sudo route add 123.123.123.123 tun0 send traffic to 123.123.123.123 :80 close the vpn sudo route del 123.123.123.123   I use the "route-nopull" option inside the .ovpn config file in order to keep the Linux machine reachable and allow simultaneous openvpn connections.  Now I need to open several independent requests, always to outbound webserver 123.123.123.123 :80. But my actual flow is serial and I need to wait the first connection to close and clear itself before attempting a second connection.  I'm quite sure that I can achieve it mangling with "fake ports". Eg:   interfaces tun0, tun1, tun2 fake ports 9000, 9001, 9002 multiple routing tables rt0, rt1, rt2   So conceptually speaking:   123.123.123.123:9000 -> mark for rt0 (tun0 is default gateway) -> rewrite as 123.123.123.123:80 -> rt0 123.123.123.123:9001 -> mark for rt1 (tun1 is default gateway) -> rewrite as 123.123.123.123:80 -> rt1 123.123.123.123:9002 -> mark for rt2 (tun2 is default gateway) -> rewrite as 123.123.123.123:80 -> rt2   I can only represent the concept because I have almost no skills on iptables. If you have different ways to achieve the result, they're welcome. Thank you for reading and helping.
118366
I have two separate Internet connections connected to a Mac and I'd like one of them (via Ethernet en0 gateway) to serve for just backing up to an remote online storage, and the other one (via Airport en1 gateway) for all other Internet traffic.  I tried using "route" from the terminal as follows:  sudo route add -host 98.207.226.113 -interface en0   (just for testing against the site www.whatismyip.org whose IP is 98.207.226.113, to see through which gateway the traffic is routed)  I can see using netstat that the route is added.  However, the traffic in this case does NOT get routed properly through Ethernet, as if the routing definition I made is ignored.  Any ideas?  Thanks!
68256
I have a development environment set up where I have a separate loopback address for multiple websites.  For example, I have the following:  127.0.0.1 www.example.com 127.0.0.2 foo.example.com 127.0.0.3 bar.example.com 127.0.0.4 waffles.example.com   I'd like an equivalent solution for IPv6.  I already know that you can use ::1 as a loopback address, but ::2, ::3, etc don't seem to work.  Are there any other loopback addresses in IPv6?  Is there a way to have multiple unique loopback addresses?
65678
I am really struggling with this.     My host (A) is behind a proxy/firewall (PF) and needs to connect to   host H.   The proxy has HTTP/FTP/SOCK proxy configured and I have no issue to configure in web browser, wget etc.  But when I use...   ssh H //to connect my host    I have no success to pass over the proxy. It seems to try to connect directly instead of going via the PF.  I am using Ubuntu 12.10.
61998
We have a custom java web app. We are setting it up in instances in different vps (different providers, different locations). We have for example:  Instance 1: http://server1/app1 Instance 2: http://server1/app2 Instance 3: http://server2/app3   Each instance is independent and self contained. We have several docens of this instances and will continue to add them.   My question is regarding the dns managment, as we want to map different subdomains to the instances.   client1.mypp.com  &gt; http://server1/app1 client2.mypp.com  &gt; http://server1/app2 client3.mypp.com  &gt; http://server2/app3  clientN.mypp.com  &gt; http://anyserver/appN   Right now we are adding the A records manually to the DNS records to relate subdomain to the ip. We will develop some code to do it using the API of the DNS provider.   Is this the most appropiate aproach? Should we use some kind of proxy instead? We expect to have thousands of isntances accros different servers. I am interested in perfomance and availability.