Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a Samba File Share that I'd like to make available to my Airport Extreme Guest Network on a different subnet. I'm hoping for read-only access to keep my home network secure, but still allow the neighbors to connect for Music, Videos, and Internet.

The Router has the option to add Port Settings with the following inputs:
Description
Public UDP Ports
Public TCP Ports
Private IP Address
Private UDP Ports
Private TCP Ports

I've added both subnets to the /etc/samba/smb.conf global/networking section:

    interfaces = 127.0.0.0/8 eth0, 10.0.1.0/24
    hosts allow = 127.0.0.1, 10.0.1.0/24, 172.16.42.0/24
    hosts deny = 0.0.0.0/0

My question is: how can I setup my Ubuntu 12.04 server to connect to both networks from the same physical NIC, to host a Samba share from one to the other?

From my understanding it would be extremely difficult if possible. My router has Port Mapping options. Maybe I could create 2 logical interfaces for the same hardware address and route all traffic by subnet. Here are a few links that show what I've found so far:
http://www.cyberciti.biz/tips/linux-how-to-setup-multi-homing-networking.html http://manpages.ubuntu.com/manpages/trusty/en/man4/vlan.4freebsd.html

Some output from my Ubuntu server:

jeff@bigJeff:/$ ifconfig
eth0      Link encap:Ethernet  HWaddr 6c:62:6d:e9:cb:ac  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:21671 errors:0 dropped:0 overruns:0 frame:0
          TX packets:21671 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:4111775 (4.1 MB)  TX bytes:4111775 (4.1 MB)

virbr0    Link encap:Ethernet  HWaddr de:52:4f:2a:40:9b  
          inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr b8:a3:86:08:53:d6  
          inet addr:10.0.0.8  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: 2601:8:9300:710:20c1:52c3:8f99:3afe/64 Scope:Global
          inet6 addr: fe80::baa3:86ff:fe08:53d6/64 Scope:Link
          inet6 addr: 2601:8:9300:710:baa3:86ff:fe08:53d6/64 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:17715061 errors:0 dropped:0 overruns:0 frame:0
          TX packets:23989125 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4221319929 (4.2 GB)  TX bytes:30915022667 (30.9 GB)

jeff@bigJeff:/$ sudo lshw -C network
  *-network               
       description: Wireless interface
       product: AR93xx Wireless Network Adapter
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:06:00.0
       logical name: wlan0
       version: 01
       serial: b8:a3:86:08:53:d6
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=3.8.0-35-generic firmware=N/A ip=10.0.0.8 latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn
       resources: irq:17 memory:fbcc0000-fbcdffff memory:fbce0000-fbceffff
  *-network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:07:00.0
       logical name: eth0
       version: 06
       serial: 6c:62:6d:e9:cb:ac
       size: 10Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl_nic/rtl8168e-2.fw latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:52 ioport:c800(size=256) memory:f8fff000-f8ffffff memory:f8ff8000-f8ffbfff

jeff@bigJeff:/$ ip route show
default via 10.0.0.1 dev wlan0  proto static 
10.0.0.0/24 dev wlan0  proto kernel  scope link  src 10.0.0.8  metric 2 
169.254.0.0/16 dev wlan0  scope link  metric 1000 
192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1

Similar posts with no answers:
1 network card/connection with 2 different IP settings
Sharing SAMBA shares across subnets
2 VPN connections on the same time(PPTP, OpenVPN)

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.