remove the gateway line from your local netcfg profile
gateway is the address to direct all traffic your computer does not know who to send. you want this to be the WAN interface, not the LAN.
Thank you that solved it!
]]>gateway is the address to direct all traffic your computer does not know who to send. you want this to be the gateway from the WAN interface, not the one from the LAN interface..
]]>like this
It makes the code more readable and more convenient to scroll through.
]]>I am using udev to change my interfaces to lan0 and wan0, and i use netcfg to load the diffrent profiles.
Lan0 uses a static local ip 192.168.0.118 with 192.168.0.2 as gateway
Wan0 uses dhcp with dynamic ip from my ISP.
When i manually bring down my lan0 interface all my traffic goes through wan0 correctly, and it even responds to external calls.
So i belive the issue lies somewhere in the local routing?
I am trying to post all config files needed directly.
/etc/rc.conf
#
# /etc/rc.conf - Main Configuration for Arch Linux
#
# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# LANG in /etc/locale.conf takes precedence
# DAEMON_LOCALE: If set to 'yes', use $LOCALE as the locale during daemon
# startup and during the boot process. If set to 'no', the C locale is used.
# HARDWARECLOCK: set to "", "UTC" or "localtime", any other value will result
# in the hardware clock being left untouched (useful for virtualization)
# Note: Using "localtime" is discouraged, using "" makes hwclock fall back
# to the value in /var/lib/hwclock/adjfile
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# Note: if unset, the value in /etc/localtime is used unchanged
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE="sv_SE.UTF-8"
DAEMON_LOCALE="no"
HARDWARECLOCK="UTC"
TIMEZONE="Europe/Stockholm"
KEYMAP="sv-latin1"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"
# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
#
# MODULES: Modules to load at boot-up. Blacklisting is no longer supported.
# Replace every !module by an entry as on the following line in a file in
# /etc/modprobe.d:
# blacklist module
# See "man modprobe.conf" for details.
#
MODULES=()
# Udev settle timeout (default to 30)
UDEV_TIMEOUT=30
# Scan for FakeRAID (dmraid) Volumes at startup
USEDMRAID="no"
# Scan for BTRFS volumes at startup
USEBTRFS="no"
# Scan for LVM volume groups at startup, required if you use LVM
USELVM="yes"
# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="weed-devil"
# Use 'ip addr' or 'ls /sys/class/net/' to see all available interfaces.
#
# Wired network setup
# - interface: name of device (required)
# - address: IP address (leave blank for DHCP)
# - netmask: subnet mask (ignored for DHCP) (optional, defaults to 255.255.255.0)
# - broadcast: broadcast address (ignored for DHCP) (optional)
# - gateway: default route (ignored for DHCP)
#
# Static IP example
# interface=eth0
# address=192.168.0.2
# netmask=255.255.255.0
# broadcast=192.168.0.255
# gateway=192.168.0.1
#
# DHCP example
# interface=eth0
# address=
# netmask=
# gateway=
#interface=eth0
#address=
#netmask=
#broadcast=
#gateway=
# Setting this to "yes" will skip network shutdown.
# This is required if your root device is on NFS.
NETWORK_PERSIST="no"
# Enable these netcfg profiles at boot-up. These are useful if you happen to
# need more advanced network features than the simple network service
# supports, such as multiple network configurations (ie, laptop users)
# - set to 'menu' to present a menu during boot-up (dialog package required)
# - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network.d
#
# This requires the netcfg package
#
NETWORKS=(sluggy local)
# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
# - prefix a daemon with a ! to disable it
# - prefix a daemon with a @ to start it up in the background
#
# If you are sure nothing else touches your hardware clock (such as ntpd or
# a dual-boot), you might want to enable 'hwclock'. Note that this will only
# make a difference if the hwclock program has been calibrated correctly.
#
# If you use a network filesystem you should enable 'netfs'.
#
DAEMONS=(syslog-ng !ufw !network net-profiles @alsa crond dbus sshd lircd sensors mysqld @ddclient @hddtemp httpd samba stunnel sabnzbd sickbeard)
/etc/network.d/sluggy
CONNECTION='ethernet'
DESCRIPTION='A basic dhcp ethernet connection using iproute'
INTERFACE='wan0'
IP='dhcp'
## for DHCPv6
#IP6='dhcp'
## for IPv6 autoconfiguration
#IP6='stateless'
/etc/network.d/local
CONNECTION='ethernet'
DESCRIPTION='A basic static ethernet connection using iproute'
INTERFACE='lan0'
IP='static'
ADDR='192.168.0.118'
GATEWAY='192.168.0.2'
output of route -nl
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.0.2 0.0.0.0 UG 0 0 0 lan0
0.0.0.0 85.24.137.1 0.0.0.0 UG 203 0 0 wan0
85.24.137.0 0.0.0.0 255.255.255.0 U 203 0 0 wan0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 lan0
I have had this server running Ubuntu for the past 2 years with the same setup on the NIC's and there everything worked, so I guess i have become a little lazy.
*EDIT* Updated my post with "code" block instead of quote
]]>