local network: 10.0.0.1/8
router ip: 10.0.0.1
openSUSE ip: 10.0.0.10
I did a fresh install of openSUSE42.2 Leap in ESXI6.5 host.My plan is to configure the openSUSE vm as a “smart” gatewate server for my local network and run some proxy on it. After this is done ,I just need to change other machines’ gateway from 10.0.0.1 to 10.0.0.10 and they can access sites blocked by my ISP. However my openSUSE did not want to act as a gateway and I’m basically a noob about network setting … I have enabled ipv4-forwarding,what else am I supposed to do now ? http://i.imgur.com/Ij7XkXD.png
Generally speaking,
You will need to set up a multi-homed (multiple NICs) machine to be a typical Default Gateway router.
At the moment you only have one virtual NIC configured, plus your loopback address… That might work if you’re configuring something like a Web Proxy(aka alternate Gateway) but won’t be sufficient to be a typical Default Gateway supporting multiple addresses. Also, consider how your design affects throughput… If you configured a single NIC for a Web Proxy for instance, then that single NIC would have to support both inbound and outbound Web Gateway network connections (essentially more than halving effective throughput).
Architecting a Default Gateway router for virtual networks is not much different than setting up for physical networks in its most basic sense. If you haven’t set up a physical Default Gateway before, it might be useful to do this first in a lab to understand those basics. After that, then it’s a small additional step to replacing physical networks with virtual networks (yes, to do this additional step you will have to know what a virtual network is, how to create, define and configure a virtual network, and then make it available to your virtual and/or physical Hosts).
Also,
At the moment you are only considering routing functionality.
If you do set up multiple networks using multiple NICs and route, then you will also have to consider how network services like DNS, DHCP and possibly network authentication is provided.
If you do intend to set up a Web Proxy gateway,
Then you will need to specify that, and then also read up on what that is, and install the appropriate software for that functionality.
I managed to make my gateway works.As suggested,I added another nic to this vm.The setting is basically the same as this article SDB:Internet_connection_sharing . The different part is that I assigned static ip to both eth0(external zone,10.0.0.10) and eth1(internal zone,10.0.0.20).After this is done,I changed the gateway from default 10.0.0.1 to 10.0.0.20 in my router’s DHCP setting page so all my devices in the local network get 10.0.0.20 as their gateway automatically. The left part is writing iptables rules.I actually have some rules now and I’ll try to write a tutorial when I’m satisfied with them.Thanks for your help TSU :shame: