How Padavan release wan port of the router system access samba

A network topology and configuration overview


1. The main router DLINK-868L, then the above light cat, LAN IP: 10.0.0.1

2. Small brush Padavan entertainment router C5 to two routers.

Firmware Version: 3.4.3.9-099_9-8-4 
the CPU: 7621A
RAM: 512M DDR3
FLASH: 32M

Two routers to the primary router WAN port of a LAN port.

Two WAN IP router to a static IP, as 10.0.0.97.

Two default IP router to LAN IP Lao Maozi: 192.168.123.1

Two routers to open the samba service.

II. Raised the issue of
default only 192.168.123.x network can access the samba shared folders, the goal now is to
connect the main router 10.0.0.x network can access the samba shared folders that open wan port samba access.

III. To solve the problem of
open router administration page http://192.168.123.1/, the user name admin, password admin.

1. Go to Advanced - Custom Settings - Script

Opening the "behind the firewall rules to enable the implementation of:"

In the bottom row logger -t "] [firewall rules" "script completes" in front of this line add the following script

# SAMBA release port
logger -t "SAMBA server []" "allow access to SAMBA"
iptables the -I the INPUT -p udp -m 1 Multiport --dport 137, 138 -j ACCEPT
iptables -p tcp -m the -I the INPUT 1 State --state NEW -m multiport --dport 139,445 -j ACCEPT

#logger -t "] [firewall rules" "script Done" (originally some line, do not join)


2. Go to Advanced Settings - Custom Settings - Script

Opening the "Custom Scripts 0 (Functional Configuration):" find the bottom "# ↑↑↑ features detailed settings ↑↑↑", add the following script in front of this line

# Samba eth2.2 wan port open port shared
Sed -i /etc/smb.conf 'S / = the interfaces * / = eth2.2 the interfaces BR0 /.'
/ Bin / the kill -9 `the pidof smbd`
the smbd -D - s /etc/smb.conf

# ↑↑↑ features detailed settings ↑↑↑ # (originally some line, do not join)

which, eth2.2 is wan port address name 10.0.0.97 interface, according to their configuration will be different.

 

How to view eth2.2 or something else?

 

Router root in, enter ifconfig View: This is my eth3

 

 

After two places above changing for the better, click on the "application of the Page Setup" and then click on the button at the top right of the restart, after restart, 192.168.1.x network can access the samba shared folder.

 

The net effect
windows Explorer to open one of these two addresses below, can enter the samba share

\\10.0.0.97
\\192.168.123.1

 

Guess you like

Origin www.cnblogs.com/housestudy/p/11365638.html