IP Forwarding for Internet Access from one machine to another
-
I am having two machines .
1st Machine:
Ubuntu Server installed with Internet Access
Having two NIC ports and having one external IP(162.16.1.6) and one internal IP(162.17.1.150)
External IP has internet access and internet IP is the gateway of the 2nd server.
I have internet from the External IP of machine12nd Machine:
Ubuntu Server installed without Internet Access
Having one NIC ports with one IP(162.17.1.151) in the segment.I need to provide internet from the 1st machine to second machine.
How to do this method by only having IP tables?
-
You need to create a bridge on the 1st machine. Here is some Ubuntu documentation... I don't think you can do this with just IPTables.
-
I have already done in my server with nic bonding for the purpose increasing the speed of internet but whether it is possible to have the bridging the servers after using the NIC bonding
-
@Lakshmana said:
I have already done in my server with nic bonding for the purpose increasing the speed of internet but whether it is possible to have the bridging the servers after using the NIC bonding
No... that doesn't really make sense does it? Bonding your NICs makes them "one" interface so you wouldn't be able to bridge between the two.
-
@coliver said:
@Lakshmana said:
I have already done in my server with nic bonding for the purpose increasing the speed of internet but whether it is possible to have the bridging the servers after using the NIC bonding
No... that doesn't really make sense does it? Bonding your NICs makes them "one" interface so you wouldn't be able to bridge between the two.
He is correct, bonding / teaming makes bridging impossible.
-
i dont want to bridge now.
i need to forward the ip for the server -
@Lakshmana said:
i dont want to bridge now.
i need to forward the ip for the serverThat would be port forwarding on the router / firewall.
-
there is no router present,i need to make my ubuntu server as a router here
-
@Lakshmana said:
there is no router present,i need to make my ubuntu server as a router here
So you do need bridging?
-
My scenario here is the master server has three nic ports(A,B,C) with two nic ports(A,B) are bonded and now the nic port(C) is not bonded.
The internet is coming from the nic port C and the nic port A,B are connected with 192 series IP which is communicating with the slave servers .
The slave servers have two NIC ports(A,B)which are also bonded and it has the IP in 192 series.
Now the internet from the NIC ports C of the master server has to be provided to the slave servers and the slave server should have the internet.
-
@Lakshmana said:
My scenario here is the master server has three nic ports(A,B,C) with two nic ports(A,B) are bonded and now the nic port(C) is not bonded.
The internet is coming from the nic port C and the nic port A,B are connected with 192 series IP which is communicating with the slave servers .
The slave servers have two NIC ports(A,B)which are also bonded and it has the IP in 192 series.
Now the internet from the NIC ports C of the master server has to be provided to the slave servers and the slave server should have the internet.
You will still need a bridge between port AB and C. Here is some info from Ubuntu. https://help.ubuntu.com/community/Router
-
I have already used the iptables to configured by this command after
nano /etc/sysctl.conf
Enabled the IP forwarding and tried
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADEIn my test machine worked properly but at the server it does not working properly.
-
@coliver said:
@Lakshmana said:
there is no router present,i need to make my ubuntu server as a router here
So you do need bridging?
Bridging and routing are different things. One is layer 2 and one is layer 3. But neither will work if he bonds the NICs.