Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 Need help on Centos Networking, Softether server issue

views
     
TSlwk523
post Feb 7 2018, 08:48 AM, updated 7y ago

Premium Q Trader
******
Senior Member
1,036 posts

Joined: Mar 2006


Hi Sifu,

I have setup a Softether server in my VPS. The connection to the server is just fine but without internet access. Does anyone can help ?

Thank you
harak_84
post Feb 7 2018, 08:59 AM

Getting Started
**
Junior Member
259 posts

Joined: May 2009


eth0 is on not??

This post has been edited by harak_84: Feb 7 2018, 08:59 AM
wailam
post Feb 7 2018, 09:02 AM

Apa benda ini?
*****
Junior Member
950 posts

Joined: Nov 2014
From: Sandakan, Sabah


did you see the networking is set on auto or manual?

TSlwk523
post Feb 7 2018, 11:41 AM

Premium Q Trader
******
Senior Member
1,036 posts

Joined: Mar 2006


This is my network status ..

Attached Image

Is required that Netmask should be the same with my eth0 for tap ?


Thank you
rootlinux
post Feb 8 2018, 12:46 PM

Enthusiast
*****
Senior Member
898 posts

Joined: Jan 2003
From: ph/sbj/slgr
QUOTE(lwk523 @ Feb 7 2018, 08:48 AM)
Hi Sifu,

I have setup a Softether server in my VPS. The connection to the server is just fine but without internet access. Does anyone can help ?

Thank you
*
Run these cmds (to check if IP forward is enabled and Masquerading is enabled): -

# cat /proc/sys/net/ipv4/ip_forward

# iptables -t nat -nvL

TSlwk523
post Feb 8 2018, 02:26 PM

Premium Q Trader
******
Senior Member
1,036 posts

Joined: Mar 2006


QUOTE(rootlinux @ Feb 8 2018, 12:46 PM)
Run these cmds (to check if IP forward is enabled and Masquerading is enabled): -

# cat /proc/sys/net/ipv4/ip_forward

# iptables -t nat -nvL
*
Attached Image


Any problem for the above ? confused.gif
rootlinux
post Feb 8 2018, 05:39 PM

Enthusiast
*****
Senior Member
898 posts

Joined: Jan 2003
From: ph/sbj/slgr
QUOTE(lwk523 @ Feb 8 2018, 02:26 PM)
Attached Image
Any problem for the above ?  confused.gif
*
yes, there is no NAT enabled. run below command: -

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

then try your internet sharing after connect to softether
TSlwk523
post Feb 8 2018, 08:18 PM

Premium Q Trader
******
Senior Member
1,036 posts

Joined: Mar 2006


QUOTE(rootlinux @ Feb 8 2018, 05:39 PM)
yes, there is no NAT enabled. run below command: -

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

then try your internet sharing after connect to softether
*
Bro you really save me... rclxms.gif rclxms.gif

Thank you bro.. thumbup.gif thumbup.gif thumbup.gif
TSlwk523
post Feb 8 2018, 09:01 PM

Premium Q Trader
******
Senior Member
1,036 posts

Joined: Mar 2006


rootlinux

Is that any way to understand that code ? I want to learn this smile.gif

This post has been edited by lwk523: Feb 8 2018, 09:01 PM
cicak360
post Feb 8 2018, 10:02 PM

Getting Started
**
Junior Member
59 posts

Joined: Sep 2009
QUOTE(lwk523 @ Feb 8 2018, 09:01 PM)
rootlinux

Is that any way to understand that code ? I want to learn this  smile.gif
*
you can try doing a
#man iptables
(full manual)
or
#iptables --help
(help command)

to see what arguments are passed along, and what are the options used.

also
https://linux.die.net/man/8/iptables


iptables are firewall rules,
this link will help explain the command you have used.

https://explainshell.com/explain?cmd=iptabl...4+-j+MASQUERADE

Half of the answers to commands are always in manuals, one quarter is in Google and the final quarter is from experience
rootlinux
post Feb 8 2018, 11:03 PM

Enthusiast
*****
Senior Member
898 posts

Joined: Jan 2003
From: ph/sbj/slgr
next you need to enable your iptables rules auto run each boot up, please read this below: -

https://www.howtoforge.com/internet-connect...rading-on-linux
TSlwk523
post Feb 8 2018, 11:13 PM

Premium Q Trader
******
Senior Member
1,036 posts

Joined: Mar 2006


QUOTE(cicak360 @ Feb 8 2018, 10:02 PM)
you can try doing a
#man iptables
(full manual)
or
#iptables --help
(help command)

to see what arguments are passed along, and what are the options used.

also
https://linux.die.net/man/8/iptables
iptables are firewall rules,
this link will help explain the command you have used.

https://explainshell.com/explain?cmd=iptabl...4+-j+MASQUERADE

Half of the answers to commands are always in manuals, one quarter is in Google and the final quarter is from experience
*
Thank you for the link and explainshell is really cool.

TSlwk523
post Feb 8 2018, 11:13 PM

Premium Q Trader
******
Senior Member
1,036 posts

Joined: Mar 2006


QUOTE(rootlinux @ Feb 8 2018, 11:03 PM)
next you need to enable your iptables rules auto run each boot up, please read this below: -

https://www.howtoforge.com/internet-connect...rading-on-linux
*
Thank you for the last step s smile.gif
TSlwk523
post Feb 20 2018, 01:00 AM

Premium Q Trader
******
Senior Member
1,036 posts

Joined: Mar 2006


QUOTE(rootlinux @ Feb 8 2018, 05:39 PM)
yes, there is no NAT enabled. run below command: -

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

then try your internet sharing after connect to softether
*
Hi rootlinux ,

Need your advice again. I need to create a port forwarding the one of the L2TP client with ip address 192.168.7.62 (internal).

iptables -t nat -A PREROUTING -d 0.0.0.0/32 -p tcp -m tcp --dport 51413 -j DNAT --to-destination 192.168.7.62:51413

Is that correct for the above ?

notworthy.gif Thank you
rootlinux
post Feb 21 2018, 03:04 PM

Enthusiast
*****
Senior Member
898 posts

Joined: Jan 2003
From: ph/sbj/slgr
QUOTE(lwk523 @ Feb 20 2018, 01:00 AM)
Hi rootlinux ,

Need your advice again. I need to create a port forwarding the one of the L2TP client with ip address 192.168.7.62 (internal).

iptables -t nat -A PREROUTING -d 0.0.0.0/32 -p tcp -m tcp --dport 51413 -j DNAT --to-destination 192.168.7.62:51413

Is that correct for the above ?

notworthy.gif Thank you
*
it looks ok, if it doesn't work then replace '-d 0.0.0.0/32' to '-d public_IP/32' or '-d wan_interface_IP/32'



 

Change to:
| Lo-Fi Version
0.0226sec    0.41    6 queries    GZIP Disabled
Time is now: 28th March 2024 - 09:41 PM