Hi!
I read for 4 days various articles on it, but being a networking and Linux Noob, could not make it work. I am out of ideas with no hope of making it on my own, so please, HELP!
I am trying to set up a laptop with linux server as a gteway/router. Laptop needs Public IP because some app does not work behind NAT. DMZ did not work, so I am setting it up to connect directly to modem and pass through internet connection to WiFi router
Laptop connects to Internet modem with USB (eth2) port, and to WiFi Router with LAN (eth0) port. In this setup, eth2 connects to internet, but eth0 is not connecting to WiFi router - Ping returns "Destination Host Unreachable."
There is no bridge and no DHCP on laptop.
When connected to LAN as Computer 3 (192.168.0.202) (eth0) it is working fine.
eth0 and eth2 are as follows
Eth0
address 192.168.0.202
netmask 255.255.255.0
network 192.168.0.0
gateway 192.168.0.1 - WiFi Routeer
Eth2
Address 68.37.253.151
netmask 255.255.252.0
Gateway 68.37.136.1
My current LAN setup:
Internet Modem -> WiFi Router (192.168.0.1)
IP Address : 68.37.253.151
Subnet Mask : 255.255.252.0
Default Gateway :68.37.136.1
DNS : 4.2.2.2 8.8.8.8
-> -> ->Computer 1 (192.168.0.100), Computer 2 (192.168.0.101), VoIP Phone (192.168.0.102)
I am trying to set up:
Internet Modem -> Linux (Ubuntu 8.04 LTE) server ->
-> WiFi Router (192.168.0.1) -> -> -> Computer 1 (192.168.0.100), Computer 2 (192.168.0.101), VoIP Phone (192.168.0.102)
Kernel IP routing table behind router reads
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
When eth2 is on, (ahead of router) it reads
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
67.37.252.0 0.0.0.0 255.255.254.0 U 0 0 0 eth2
I edited file /etc/init.d/firewall.sh
iptables --table nat --append POSTROUTING --out-interface eth2 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
Edited /etc/sysctl.conf
to enable net.ipv4.ip_forward=1
Thank you for reading.
I read for 4 days various articles on it, but being a networking and Linux Noob, could not make it work. I am out of ideas with no hope of making it on my own, so please, HELP!
I am trying to set up a laptop with linux server as a gteway/router. Laptop needs Public IP because some app does not work behind NAT. DMZ did not work, so I am setting it up to connect directly to modem and pass through internet connection to WiFi router
Laptop connects to Internet modem with USB (eth2) port, and to WiFi Router with LAN (eth0) port. In this setup, eth2 connects to internet, but eth0 is not connecting to WiFi router - Ping returns "Destination Host Unreachable."
There is no bridge and no DHCP on laptop.
When connected to LAN as Computer 3 (192.168.0.202) (eth0) it is working fine.
eth0 and eth2 are as follows
Eth0
address 192.168.0.202
netmask 255.255.255.0
network 192.168.0.0
gateway 192.168.0.1 - WiFi Routeer
Eth2
Address 68.37.253.151
netmask 255.255.252.0
Gateway 68.37.136.1
My current LAN setup:
Internet Modem -> WiFi Router (192.168.0.1)
IP Address : 68.37.253.151
Subnet Mask : 255.255.252.0
Default Gateway :68.37.136.1
DNS : 4.2.2.2 8.8.8.8
-> -> ->Computer 1 (192.168.0.100), Computer 2 (192.168.0.101), VoIP Phone (192.168.0.102)
I am trying to set up:
Internet Modem -> Linux (Ubuntu 8.04 LTE) server ->
-> WiFi Router (192.168.0.1) -> -> -> Computer 1 (192.168.0.100), Computer 2 (192.168.0.101), VoIP Phone (192.168.0.102)
Kernel IP routing table behind router reads
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
When eth2 is on, (ahead of router) it reads
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
67.37.252.0 0.0.0.0 255.255.254.0 U 0 0 0 eth2
I edited file /etc/init.d/firewall.sh
iptables --table nat --append POSTROUTING --out-interface eth2 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
Edited /etc/sysctl.conf
to enable net.ipv4.ip_forward=1
Thank you for reading.