LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   second adapter gateway not visible on different subnet (https://www.linuxquestions.org/questions/linux-networking-3/second-adapter-gateway-not-visible-on-different-subnet-4175554668/)

cnschulz 09-27-2015 04:34 PM

second adapter gateway not visible on different subnet
 
Gday,

I have a Vodafone (Huawei) K4203 dongle. It is NOT a modem ie: it creates a network adapter on the machine. I am attempting to run it on a headless ubuntu 12.04 server in addition to the current ethernet network in that machine. I wish for this machine to become my "gateway" to the internet. Im very close but cant get the rest of the network to see the gateway. Im not sure what I need to do from here.

The card is installed correctly and the on-board web-server indicates connectivity. The host machine has internet access.

The server has two network interfaces:
eth3 is a traditional wired nic on 192.168.1.3. Gateway is 192.168.9.1
eth4 is the usb adapter which by default uses its own DHCP. It has a local address of 192.168.9.100 but has its own status page reachable at 192.168.9.1.

I have a wireless router with 4 wired ports at 192.168.1.2. This *used* to be my gateway to a traditonal DSL modem but this is no longer the case. I wish to route through the USB adapter now.

All machines on the 192.168.1.x network can see the 192.168.9.100 address but CANNOT see the 192.168.9.1 gateway (!!) only the host machine 192.168.1.3 can see this.

So, what do I need to do to have all machines on the 192.168.1.x network able to see the internet?

Code:

Kernel IP routing table
Destination    Gateway        Genmask        Flags  MSS Window  irtt Iface
0.0.0.0        192.168.9.1    0.0.0.0        UG        0 0          0 eth4
192.168.1.0    0.0.0.0        255.255.255.0  U        0 0          0 eth3
192.168.9.0    0.0.0.0        255.255.255.0  U        0 0          0 eth4


Code:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo eth3 eth4
iface lo inet loopback

# The primary network interface
iface eth3 inet static
        address 192.168.1.3
        netmask 255.255.255.0
        broadcast 192.168.1.255
        network 192.168.1.0

# The usb network interface
iface eth4 inet dhcp

What else can I tell you?
Thanks for any help.

ferrari 09-27-2015 10:01 PM

So, I understand you are configure like this, with your PC acting as a router

LAN-----eth3 (192.168.1.3/24)<PC>eth4 (192.168.9.100)-----gw (192.168.9.1)

The LAN clients should be able to reach the internet directly with the routing table you have shown, and from the LAN perspective the local gateway is 192.168.1.3, with your PC taking care of the routing to the VF dongle.

ferrari 09-28-2015 03:18 AM

Another thought that I had was to make sure that IP forwarding is enabled too.

Check with
Code:

cat /proc/sys/net/ipv4/ip_forward
If necessary
Code:

echo 1 > /proc/sys/net/ipv4/ip_forward
It can be made permanent by adding the following to /etc/sysctl.conf
Code:

net.ipv4.ip_forward=1

cnschulz 09-28-2015 04:33 AM

SOLVED!!!

Thankyou so much. It was a combination of two things:

1. allowing ip_forward as you suggested and...
2. enabling NAT on eth4 (internet side) on the firewall (the firewall wasnt enabled at all) as suggested in this post : http://www.linuxquestions.org/questi...in-4175427064/

:)

ferrari 09-28-2015 04:37 AM

Glad to have been of help! :)


All times are GMT -5. The time now is 04:44 AM.